Skip to content

Commit

Permalink
Try fly deployment GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
thadk committed Nov 30, 2023
1 parent 2116a50 commit a1eeaf2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 42 deletions.
83 changes: 42 additions & 41 deletions .github/workflows/heat-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- test-rules-whl-deployment
# - dev
pull_request: {}

Expand Down Expand Up @@ -155,46 +156,46 @@ jobs:
# path: playwright-report/
# retention-days: 30

# deploy:
# name: πŸš€ Deploy
# runs-on: ubuntu-latest
# needs: [lint, typecheck, vitest, playwright]
# # only build/deploy main branch on pushes
# if:
# ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') &&
# github.event_name == 'push' }}
deploy:
name: πŸš€ Deploy
runs-on: ubuntu-latest
needs: [lint, typecheck, vitest] #, playwright]
# only build/deploy main branch on pushes
if:
${{ (github.ref == 'test-rules-whl-deployment' || github.ref == 'refs/heads/dev') &&
github.event_name == 'push' }}

# steps:
# - name: ⬇️ Checkout repo
# uses: actions/checkout@v3
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

# - name: πŸ‘€ Read app name
# uses: SebRollen/[email protected]
# id: app_name
# with:
# file: 'fly.toml'
# field: 'app'

# # move Dockerfile to root
# - name: 🚚 Move Dockerfile
# run: |
# mv ./other/Dockerfile ./Dockerfile
# mv ./other/.dockerignore ./.dockerignore

# - name: 🎈 Setup Fly
# uses: superfly/flyctl-actions/[email protected]

# - name: πŸš€ Deploy Staging
# if: ${{ 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 }}
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: πŸ‘€ Read app name
uses: SebRollen/[email protected]
id: app_name
with:
file: '${{ env.working-directory }}/fly.toml'
field: 'app'

# move Dockerfile to root
- name: 🚚 Move Dockerfile
run: |
mv ${{ env.working-directory }}/other/Dockerfile ./Dockerfile
mv ${{ env.working-directory }}/other/.dockerignore ./.dockerignore
- name: 🎈 Setup Fly
uses: superfly/flyctl-actions/[email protected]

- name: πŸš€ Deploy Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run:
flyctl deploy ${{ env.working-directory }} --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 == 'test-rules-whl-deployment' }}
run:
flyctl deploy ${{ env.working-directory }} --remote-only --build-arg COMMIT_SHA=${{ github.sha }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
2 changes: 1 addition & 1 deletion heat-stack/fly.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app = "heat-app-7964"
primary_region = "sjc"
primary_region = "box"
kill_signal = "SIGINT"
kill_timeout = 5
processes = [ ]
Expand Down

0 comments on commit a1eeaf2

Please sign in to comment.