diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index af0c621..87d9fa5 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -5,6 +5,11 @@ on: branches: - main workflow_dispatch: + inputs: + reason: + description: "Reason for manual deploy" + required: false + default: "manual" env: COMPOSE_PROJECT: outline-sync @@ -20,6 +25,7 @@ jobs: token: ${{ secrets.GITEA_TOKEN }} - name: Bump patch version + if: github.event_name != 'workflow_dispatch' run: | VERSION=$(cat VERSION) MAJOR=$(echo $VERSION | cut -d. -f1) @@ -44,8 +50,9 @@ jobs: - name: Deploy with docker compose run: | - echo "=== Deploying ${{ env.APP_VERSION }} (commit ${{ gitea.sha }}) to ${{ gitea.ref_name }} ===" - docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" build --build-arg APP_VERSION=${{ env.APP_VERSION }} + APP_VERSION=${APP_VERSION:-$(cat VERSION)} + echo "=== Deploying $APP_VERSION (commit ${{ gitea.sha }}) to ${{ gitea.ref_name }} ===" + docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" build --build-arg APP_VERSION=$APP_VERSION docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" up -d --remove-orphans - name: Prune dangling images