Update dependencies, add an auto update cron job #9
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: build and push | |
on: | |
push: {} | |
repository_dispatch: | |
types: [run] | |
workflow_dispatch: {} | |
jobs: | |
build_and_push_to_registry: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
version: [18, 20, 22] | |
env: | |
STACK_VERSION: ${{ matrix.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# CNB are not multi-arch ready as of May 2022 so this is not needed | |
# It causes problems with this workflow so test later | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache var-cache-apt | |
uses: actions/cache@v3 | |
with: | |
path: var-cache-apt | |
key: var-cache-apt-${{ hashFiles('Dockerfile') }} | |
- name: Cache var-lib-apt | |
uses: actions/cache@v4 | |
with: | |
path: var-lib-apt | |
key: var-lib-apt-${{ hashFiles('Dockerfile') }} | |
- name: inject var-cache-apt into docker | |
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | |
with: | |
cache-source: var-cache-apt | |
cache-target: /var/cache/apt | |
- name: inject var-lib-apt into docker | |
uses: reproducible-containers/buildkit-cache-dance@v2.1.4 | |
with: | |
cache-source: var-lib-apt | |
cache-target: /var/lib/apt | |
- name: Build and push for stack ${{ env.STACK_VERSION }} | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
build-args: | | |
STACK_VERSION=-${{ env.STACK_VERSION }} | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}/${{ github.ref_name }}:${{ github.sha }} | |
ghcr.io/${{ github.repository }}/${{ github.ref_name }}:latest-${{ env.STACK_VERSION }} | |
ghcr.io/${{ github.repository }}/${{ github.ref_name }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# acdhch/${{ inputs.image_tagged }} |