Skip to content

Commit

Permalink
Deploy to Fly
Browse files Browse the repository at this point in the history
  • Loading branch information
nbudin committed Sep 12, 2023
1 parent 2d14513 commit 7242d05
Showing 1 changed file with 8 additions and 42 deletions.
50 changes: 8 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,51 +25,17 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.release.name }}
ghcr.io/${{ github.repository }}:latest
heroku-release:
fly-release:
runs-on: ubuntu-latest
needs:
- docker-release
strategy:
matrix:
app:
- eventlite-annewil
- eventlite-occultopus
- journeysurveys
steps:
- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Log into Heroku Container Registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Write dockerfiles
run: |
echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >>Dockerfile.web
echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >>Dockerfile.release
echo "CMD bundle exec bin/rails db:migrate" >>Dockerfile.release
- name: Build web image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.web
load: true
platforms: linux/amd64
tags: registry.heroku.com/${{ matrix.app }}/web
- name: Build release image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.release
load: true
platforms: linux/amd64
tags: registry.heroku.com/${{ matrix.app }}/release
- name: Push built images
run: |
docker push registry.heroku.com/${{ matrix.app }}/web
docker push registry.heroku.com/${{ matrix.app }}/release
- name: Perform release
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only -a ${{ matrix.app }}
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release -a ${{ matrix.app }} web release
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

0 comments on commit 7242d05

Please sign in to comment.