Skip to content

Commit

Permalink
yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick80 committed Feb 18, 2024
1 parent f839731 commit ff2727d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- development
pull_request: {}

env:
FLY_APP_NAME: ${{ secrets.FLY_APP_NAME }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,7 +16,7 @@ permissions:

jobs:
deploy:
name: 🚀 Deploy STUFF
name: 🚀 Deploy Staging
runs-on: ubuntu-latest
if:
${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development') &&
Expand All @@ -28,23 +26,28 @@ jobs:
- 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 ${{
secrets.FLY_APP_NAME
}}-staging
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 }}
FLY_APP_NAME: ${{ secrets.FLY_APP_NAME }}

- name: 🚀 Deploy Production
if: ${{ github.ref == 'refs/heads/main' }}
run:
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
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 }}

0 comments on commit ff2727d

Please sign in to comment.