Skip to content

Commit

Permalink
Release to Fly.io
Browse files Browse the repository at this point in the history
  • Loading branch information
nbudin committed Sep 15, 2023
1 parent 457e55a commit 00362cb
Showing 1 changed file with 8 additions and 41 deletions.
49 changes: 8 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +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:
- vellum-aegames
- vellum
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 rake 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 00362cb

Please sign in to comment.