Skip to content

Uncomment vat (#450) #154

Uncomment vat (#450)

Uncomment vat (#450) #154

name: Build and push docker image
on:
push:
branches:
- '*'
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
HAWK_TOKEN: ${{ secrets.HAWK_TOKEN }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get package info
id: packageInfo
uses: codex-team/action-nodejs-package-info@v1
- name: Send release data
uses: codex-team/hawk.releases@v1
with:
release: ${{ steps.packageInfo.outputs.name }}-${{ steps.packageInfo.outputs.version }}
token: ${{ secrets.HAWK_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=raw,value={{branch}}-{{sha}}-{{date 'X'}},enable=${{ startsWith(github.ref, 'refs/heads') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.prod
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ startsWith(github.ref, 'refs/tags/v') || endsWith(github.ref, '/stage') || endsWith(github.ref, '/prod') }}