2022-03-09 19:13:15 +01:00
|
|
|
name: Build snapshot
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
2022-04-13 14:04:28 +02:00
|
|
|
IMAGE_NAME_WITH_INFCLOUD: parrazam/radicale-with-infcloud
|
2023-09-28 20:51:51 +02:00
|
|
|
PLATFORMS: linux/amd64,linux/arm64
|
2022-03-09 19:13:15 +01:00
|
|
|
GH_REPO: ghcr.io
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build-and-push-docker-image:
|
|
|
|
name: Build Docker snapshot
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-09-04 16:51:31 +02:00
|
|
|
uses: actions/checkout@v4
|
2022-03-09 19:13:15 +01:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
id: qemu
|
2023-09-29 16:15:27 +02:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-03-09 19:13:15 +01:00
|
|
|
with:
|
|
|
|
image: tonistiigi/binfmt:latest
|
|
|
|
platforms: ${{ env.PLATFORMS }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-09-12 16:22:13 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-03-09 19:13:15 +01:00
|
|
|
|
2022-04-13 13:47:58 +02:00
|
|
|
- name: Log into ${{ env.GH_REPO }} registry
|
2023-09-12 16:22:16 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-03-09 19:13:15 +01:00
|
|
|
with:
|
|
|
|
registry: ${{ env.GH_REPO }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-04-13 13:47:58 +02:00
|
|
|
|
|
|
|
- name: Log into DockerHub registry
|
2023-09-12 16:22:16 +02:00
|
|
|
uses: docker/login-action@v3
|
2022-04-13 13:47:58 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2022-03-09 19:13:15 +01:00
|
|
|
|
|
|
|
- name: Extract Docker metadata
|
|
|
|
id: meta
|
2023-09-12 16:22:10 +02:00
|
|
|
uses: docker/metadata-action@v5
|
2022-03-09 19:13:15 +01:00
|
|
|
with:
|
2022-04-13 13:47:58 +02:00
|
|
|
images: |
|
|
|
|
${{ env.GH_REPO }}/${{ env.IMAGE_NAME }}
|
|
|
|
${{ env.IMAGE_NAME }}
|
2022-04-13 14:04:28 +02:00
|
|
|
${{ env.IMAGE_NAME_WITH_INFCLOUD }}
|
2022-03-09 19:13:15 +01:00
|
|
|
|
|
|
|
- name: Build image and push snapshot to GitHub Container Registry
|
|
|
|
id: build-and-push
|
2024-06-17 16:13:46 +02:00
|
|
|
uses: docker/build-push-action@v6
|
2022-03-09 19:13:15 +01:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2022-04-13 14:04:28 +02:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
2022-03-09 19:13:15 +01:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|