Skip to content

Fix prod workflow

Fix prod workflow #10

Workflow file for this run

name: Production Workflow
on:
push:
branches:
- 'master'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
EMAILJS_PUBLIC_KEY: ${{ secrets.EMAIL_TOKEN }}
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Heroku Container Registry
run: docker login --username=${{ secrets.HEROKU_EMAIL }} --password=${{ secrets.HEROKU_API_KEY }} registry.heroku.com
- name: Build and push Docker image
run: docker build -t ${{ secrets.DOCKER_IMAGE_NAME }} -f Dockerfile .
- name: Push Docker image
run: heroku container:push web --app ${{ secrets.HEROKU_APP_NAME }}
- name: Tag docker image and heroku registry
run: docker tag ${{ secrets.DOCKER_IMAGE_NAME }} registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
- name: Push Docker image to Heroku registry
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
- name: Install Heroku CLI
run: |
curl https://cli-assets.heroku.com/install.sh | sh
- name: Release Docker image
run: |
heroku container:push web --app ${{ secrets.HEROKU_APP_NAME }}
heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }}
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}