Publish Kitodo.Production #293
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Kitodo.Production | |
on: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 0 * * *' # run daily | |
workflow_dispatch: # run manually | |
env: | |
REGISTRY_PATH: ghcr.io/slub/kitodo-production-docker | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Kitodo.Production Docker Repository | |
uses: actions/checkout@v3 | |
- name: Checkout Kitodo.Production Repository | |
uses: actions/checkout@v3 | |
with: | |
repository: kitodo/kitodo-production | |
path: _tmp/kitodo-production | |
- # Activate cache export feature to reduce build time of images | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine build args | |
run: | | |
date -u +"build_date=%Y-%m-%dT%H:%M:%SZ" >> $GITHUB_ENV | |
echo "vcs_ref=`git -C ./_tmp/kitodo-production rev-parse --short HEAD`" >> $GITHUB_ENV | |
- name: Build the Kitodo.Production image and deploy to GitHub Container Repository | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY_PATH }}/kitodo_production:latest | |
build-args: | | |
BUILD_DATE=${{ env.build_date }} | |
VCS_REF=${{ env.vcs_ref }} | |
VCS_URL=https://github.com/kitodo/kitodo-production/ | |
BUILDER_TYPE=git | |
BUILDER_GIT_REF=master | |
BUILDER_GIT_REPOSITORY=kitodo/kitodo-production | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |