From 18482d97794ef49e999c6d9e5cb494de83ce13fb Mon Sep 17 00:00:00 2001 From: Alex Krantz Date: Sun, 5 May 2024 14:22:29 -0700 Subject: [PATCH] Deploy to fly.io --- .github/workflows/deploy.yml | 20 ++++++++++++++++++++ .gitignore | 1 + 2 files changed, 21 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8113714..1a4b771 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -60,3 +60,23 @@ jobs: cache-to: type=gha,mode=max cache-from: type=gha + + launch: + name: Launch + runs-on: ubuntu-22.04 + if: github.ref == 'refs/heads/main' + needs: + - build + concurrency: + group: deploy-launch + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@v1 + + - name: Generate commit SHA + id: sha + run: echo "value=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + + - run: flyctl deploy --remote-only --image ${{ env.IMAGE_REGISTRY }}/service:deploy-${{ steps.sha.outputs.value }} + env: + FLY_API_TOKEN: ${{ secrets.FLY_DEPLOY_TOKEN }} diff --git a/.gitignore b/.gitignore index 0ab0cd3..574854a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target/ /.idea/ config.yaml +.env