Skip to content

ci(docker): fix docker build #153

ci(docker): fix docker build

ci(docker): fix docker build #153

Workflow file for this run

name: Docker
# Run workflow on tags starting with v (eg. v2, v1.2.0)
on:
push:
jobs:
tzgenerate:
uses: ./.github/workflows/generate-timezones.yml
docker-build:
needs: tzgenerate
runs-on: ubuntu-latest
strategy:
matrix:
bin: [ical-relay, ical-notifier]
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Download timezone data
uses: actions/download-artifact@v4
id: download_tzdata
with:
name: combined_vtimezones.ics
path: pkg/helpers/
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/jm-lemmi/${{ matrix.bin }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{raw}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=ref,event=branch
- name: Meta is_tag
run: echo "IS_TAG=$([[ $GITHUB_REF == refs/tags/* ]] && echo true || echo false)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: ./cmd/${{ matrix.bin }}/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm
push: ${{ env.IS_TAG }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BUILDKIT_CONTEXT_KEEP_GIT_DIR=true