Test deployment to heroku #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test deploy | |
on: | |
push: | |
branches: ['*'] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
REGISTRY_IMAGE: registry.heroku.com/navigate-dev-gn/web | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- name: Install Heroku CLI | |
run: | | |
curl https://cli-assets.heroku.com/install.sh | sh | |
- name: Login to Heroku Container registry | |
env: | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
run: heroku container:login | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
- name: Set version | |
run: | | |
cd packages/configs | |
pnpm pkg set version="${VERSION:11}+$(date +'%Y%m%d').$(git rev-parse --short HEAD)" | |
env: | |
VERSION: ${{ github.ref }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
id: build | |
with: | |
context: . | |
file: packages/configs/Dockerfile | |
push: true | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ env.REGISTRY_IMAGE }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
load: true | |
- name: Deploy | |
run: heroku container:release web --app=navigate-dev-gn |