Skip to content

Commit

Permalink
Merge pull request #597 from indirect/deployment-tracking
Browse files Browse the repository at this point in the history
try adding github deployment tracking
  • Loading branch information
indirect authored Dec 13, 2024
2 parents c285049 + 3995793 commit 4d56b82
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: CI

on:
push:
branches: [ "**", "!dependabot/**" ]
pull_request:

env:
RAILS_ENV: test

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,14 +48,3 @@ jobs:
if: always()
with:
sarif_file: tmp/sarif
deploy:
runs-on: ubuntu-latest
needs: [test, lint]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only --build-arg "GIT_SHA=${{ github.sha }}"
env:
FLY_APP: feedyouremail
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy

on:
workflow_run:
workflows: [CI]
types: [completed]

permissions:
contents: read
deployments: write

env:
FLY_APP: feedyouremail

jobs:
deploy:
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == github.event.repository.default_branch
concurrency: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dentarg/fly@v1
with:
build-args: "GIT_SHA=${{ github.sha }}"
fly-token: ${{ secrets.FLY_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4d56b82

Please sign in to comment.