Skip to content

v2.1.5

v2.1.5 #6

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
docker-release:
runs-on: ubuntu-latest
steps:
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Write dockerfile for release
run: |
echo "FROM ghcr.io/${{ github.repository }}:${{ github.sha }}" >Dockerfile
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
ghcr.io/${{ github.repository }}:${{ github.event.release.name }}
ghcr.io/${{ github.repository }}:latest
heroku-release:
runs-on: ubuntu-latest
strategy:
matrix:
app:
- vellum-aegames
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
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:release -a ${{ matrix.app }} web release