Skip to content

chore(dev): update dependency pre-commit to v3.3.3 (#91) #177

chore(dev): update dependency pre-commit to v3.3.3 (#91)

chore(dev): update dependency pre-commit to v3.3.3 (#91) #177

Workflow file for this run

name: release
on:
push:
tags:
- v*
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
env:
IMAGE: "ghcr.io/${{ github.repository_owner }}/ms-timeline"
concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: build base docker image
env:
FILES_HASH: "${{ hashFiles('poetry.lock', 'etc/*.dockerfile') }}"
run: |
export "TAG_HASH=base-${FILES_HASH}"
echo "TAG_HASH=${TAG_HASH}" >>$GITHUB_ENV
if ! docker pull "${IMAGE}:${TAG_HASH}"; then
echo "NEED_BUILD_BASE=true" >>$GITHUB_ENV
else
echo "NEED_BUILD_BASE=false" >>$GITHUB_ENV
fi
- name: Build Base Docker Image (if needed)
uses: docker/build-push-action@v4
if: ${{ env.NEED_BUILD_BASE }}
with:
context: ./
file: ./etc/base.dockerfile
provenance: false
push: true
tags: ${{ env.IMAGE }}:${{ env.TAG_HASH }}
- run: docker tag "${IMAGE}:${TAG_HASH}" base-image
- run: echo "SHA=$(git show --no-patch --no-notes --date=short-local --pretty='%as-%h')" >> $GITHUB_ENV
env:
TZ: UTC
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern=v{{version}}
type=ref,event=branch
type=sha,prefix={{branch}}-
type=ref,event=branch,suffix=-${{ env.SHA }}
type=raw,value=${{ env.SHA }}
- name: Build Final Docker Image
uses: docker/build-push-action@v4
with:
context: ./
provenance: false
file: ./etc/final.dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}