2022-03-09 19:13:15 +01:00
|
|
|
name: Build and Publish tag version
|
2022-03-03 12:40:16 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-09 19:13:15 +01:00
|
|
|
tags: [ '*.*.*.*' ]
|
2022-03-03 12:40:16 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
2022-04-13 14:25:47 +02:00
|
|
|
IMAGE_NAME_WITH_INFCLOUD: parrazam/radicale-with-infcloud
|
2023-03-15 12:23:09 +01:00
|
|
|
PLATFORMS: linux/amd64,linux/arm64
|
2022-03-04 12:52:45 +01:00
|
|
|
GH_REPO: ghcr.io
|
2022-03-03 12:40:16 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2022-03-04 12:52:45 +01:00
|
|
|
build-and-push-docker-image:
|
|
|
|
name: Build Docker image and push to repositories
|
2022-03-03 12:40:16 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
steps:
|
2022-03-04 12:52:45 +01:00
|
|
|
- name: Checkout code
|
2022-03-09 19:13:15 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-03-03 12:40:16 +01:00
|
|
|
|
|
|
|
- name: Install cosign
|
2022-03-09 19:13:15 +01:00
|
|
|
uses: sigstore/cosign-installer@main
|
2022-03-03 12:40:16 +01:00
|
|
|
|
2022-03-04 12:52:45 +01:00
|
|
|
- name: Set up QEMU
|
|
|
|
id: qemu
|
2022-05-06 16:34:42 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-03-04 12:52:45 +01:00
|
|
|
with:
|
|
|
|
image: tonistiigi/binfmt:latest
|
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2022-03-03 12:40:16 +01:00
|
|
|
|
2022-03-04 12:52:45 +01:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2022-05-06 16:34:37 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-04-13 14:25:47 +02:00
|
|
|
|
|
|
|
- name: Log into ${{ env.GH_REPO }} registry
|
2022-05-06 16:34:39 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-03-03 12:40:16 +01:00
|
|
|
with:
|
2022-03-04 12:52:45 +01:00
|
|
|
registry: ${{ env.GH_REPO }}
|
2022-03-03 12:40:16 +01:00
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-04-13 14:25:47 +02:00
|
|
|
- name: Login to DockerHub registry
|
2022-05-06 16:34:39 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-04-13 14:25:47 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2022-03-03 12:40:16 +01:00
|
|
|
- name: Extract Docker metadata
|
|
|
|
id: meta
|
2022-05-05 16:42:12 +02:00
|
|
|
uses: docker/metadata-action@v4
|
2022-03-03 12:40:16 +01:00
|
|
|
with:
|
2022-03-04 12:52:45 +01:00
|
|
|
images: |
|
|
|
|
${{ env.IMAGE_NAME }}
|
2022-04-13 14:25:47 +02:00
|
|
|
${{ env.IMAGE_NAME_WITH_INFCLOUD }}
|
2022-03-04 12:52:45 +01:00
|
|
|
${{ env.GH_REPO }}/${{ env.IMAGE_NAME }}
|
2022-03-09 19:13:15 +01:00
|
|
|
tags: |
|
|
|
|
type=match,pattern=\d.\d.\d.\d
|
|
|
|
labels: |
|
|
|
|
maintainer=parrazam
|
|
|
|
org.opencontainers.image.title=Radicale with InfCloud
|
|
|
|
org.opencontainers.image.description=Radicale with InfCloud interface included
|
|
|
|
org.opencontainers.image.vendor=ParraSoft
|
|
|
|
|
2022-03-04 12:52:45 +01:00
|
|
|
- name: Build image and push to Docker Hub and GitHub Container Registry
|
2022-03-03 12:40:16 +01:00
|
|
|
id: build-and-push
|
2023-01-31 15:03:57 +01:00
|
|
|
uses: docker/build-push-action@v4
|
2022-03-03 12:40:16 +01:00
|
|
|
with:
|
|
|
|
context: .
|
2022-03-09 19:13:15 +01:00
|
|
|
build-args: VERSION=${{ github.ref_name }}
|
2022-03-04 12:52:45 +01:00
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2022-03-09 19:13:15 +01:00
|
|
|
push: true
|
2022-03-03 12:40:16 +01:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|