This file contains 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 Staging | |
on: | |
push: | |
branches: | |
- main | |
- development | |
pull_request: {} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
deploy: | |
name: 🚀 Deploy Staging | |
runs-on: ubuntu-latest | |
if: | |
${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development') && | |
github.event_name == 'push' }} | |
steps: | |
- name: 👀 Checkout Repo | |
uses: actions/checkout@v3 | |
- name: 👀 Read app name | |
uses: SebRollen/toml-action@v1.2.0 | |
id: app_name | |
with: | |
file: fly.toml | |
field: app | |
- name: 🎈 Setup Fly | |
uses: superfly/flyctl-actions/setup-flyctl@1.5 | |
- name: 🚀 Deploy Staging | |
if: ${{ github.ref == 'refs/heads/development' || github.ref == 'refs/heads/dev' }} | |
run: | | |
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | |
--app ${{ steps.app_name.outputs.value }}-staging | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: 🚀 Deploy Production | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | |
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | |
--app ${{ steps.app_name.outputs.value }}-Production | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |