Skip to content

fix: flake (vendorHash) #44

fix: flake (vendorHash)

fix: flake (vendorHash) #44

Workflow file for this run

name: docker
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set build tag env vars
run: |
echo "PGM_VERSION=$(cat ./VERSION)" >> $GITHUB_ENV
echo "PGM_COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- id: dockermetadata
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/peterldowns/pgmigrate
tags: |
# short sha of the commit
type=sha,prefix=,suffix=,format=short
# long sha of the commit
type=sha,prefix=,suffix=,format=long
# "latest"
type=raw,value=${{ env.PGM_VERSION }}
type=raw,value=${{ env.PGM_VERSION }}-commit.${{ env.PGM_COMMIT_SHA }}
type=raw,value=latest
- uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.dockermetadata.outputs.tags }}
labels: ${{ steps.dockermetadata.outputs.labels }}
build-args: |
VERSION=${{ env.PGM_VERSION }}
COMMIT_SHA=${{ env.PGM_COMMIT_SHA }}