Skip to content

Try to fix prod workflow #3

Try to fix prod workflow

Try to fix prod workflow #3

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 --platform linux/amd64 -t ${{ secrets.DOCKER_IMAGE_NAME }} . --load
docker build -t registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web .
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 }}