Deploy to Orchard #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Orchard | |
| on: | |
| workflow_run: | |
| workflows: ['Publish Backend Docker Image'] | |
| types: [completed] | |
| branches: ['main'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: ./.github/workflows/publish-docker.yaml | |
| permissions: | |
| contents: read | |
| packages: write | |
| deploy: | |
| needs: [build] | |
| if: always() && (github.event.workflow_run.conclusion == 'success' || needs.build.result == 'success') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Orchard deploy | |
| env: | |
| WEBHOOK_URL: ${{ secrets.ORCHARD_WEBHOOK_URL }} | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha || github.sha }} | |
| run: | | |
| SHORT_SHA="${HEAD_SHA:0:7}" | |
| curl -sf -X POST "$WEBHOOK_URL" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"tag\": \"sha-${SHORT_SHA}\"}" |