Consolidate CI pipeline
Test on every commit, deploy only on main
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
|
|
||||||
|
|
||||||
name: Fly Deploy
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Deploy app
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
concurrency: deploy-group # optional: ensure only one action runs at a time
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: superfly/flyctl-actions/setup-flyctl@master
|
|
||||||
- run: flyctl deploy --remote-only
|
|
||||||
env:
|
|
||||||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Test
|
name: Test & Deploy
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -50,3 +50,15 @@ jobs:
|
|||||||
shell: sh
|
shell: sh
|
||||||
- run: mix deps.get
|
- run: mix deps.get
|
||||||
- run: mix test
|
- run: mix test
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy app
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
concurrency: deploy-group # optional: ensure only one action runs at a time
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: superfly/flyctl-actions/setup-flyctl@master
|
||||||
|
- run: flyctl deploy --remote-only
|
||||||
|
env:
|
||||||
|
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
||||||
Reference in New Issue
Block a user