Deploy Staging #16
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 Staging | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: Commit SHA, branch, or tag to deploy (defaults to main) | |
| required: false | |
| workflow_run: | |
| workflows: [CI] | |
| types: [completed] | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| name: Deploy to Staging | |
| if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| environment: staging | |
| concurrency: | |
| group: deploy-staging | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.ref || github.event.workflow_run.head_sha || github.sha }} | |
| - run: mkdir -p apps/ssh/docs && curl -sL https://supabase.com/docs/docs.tar.gz | tar -xz -C apps/ssh/docs | |
| - uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # v1 | |
| - run: | | |
| VERSION=${{ github.ref_name }}-$(git rev-parse --short HEAD) | |
| flyctl deploy ../.. --config "$(pwd)/fly.toml" --build-arg VERSION="$VERSION" | |
| working-directory: apps/ssh | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
| FLY_APP: ${{ vars.FLY_APP }} |