mirror of
https://github.com/parrazam/radicale-docker.git
synced 2024-09-01 19:50:24 +02:00
93 lines
2.9 KiB
YAML
93 lines
2.9 KiB
YAML
name: Build and Publish tag version
|
|
|
|
on:
|
|
push:
|
|
tags: [ '*.*.*.*' ]
|
|
|
|
env:
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
|
|
GH_REPO: ghcr.io
|
|
|
|
jobs:
|
|
|
|
build-and-push-docker-image:
|
|
name: Build Docker image and push to repositories
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install cosign
|
|
uses: sigstore/cosign-installer@main
|
|
|
|
- name: Set up QEMU
|
|
id: qemu
|
|
uses: docker/setup-qemu-action@v1
|
|
with:
|
|
image: tonistiigi/binfmt:latest
|
|
platforms: ${{ env.PLATFORMS }}
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Log into registry ${{ env.REGISTRY }}
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ${{ env.GH_REPO }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: |
|
|
${{ env.IMAGE_NAME }}
|
|
${{ env.GH_REPO }}/${{ env.IMAGE_NAME }}
|
|
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
|
|
|
|
- name: Build image and push to Docker Hub and GitHub Container Registry
|
|
id: build-and-push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
build-args: VERSION=${{ github.ref_name }}
|
|
platforms: ${{ env.PLATFORMS }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
# Sign the resulting Docker image digest except on PRs.
|
|
# This will only write to the public Rekor transparency log when the Docker
|
|
# repository is public to avoid leaking data. If you would like to publish
|
|
# transparency data even for private images, pass --force to cosign below.
|
|
# https://github.com/sigstore/cosign
|
|
- name: Sign the published Docker image
|
|
env:
|
|
COSIGN_EXPERIMENTAL: "true"
|
|
# This step uses the identity token to provision an ephemeral certificate
|
|
# against the sigstore community Fulcio instance.
|
|
run: cosign sign ${{ env.GH_REPO }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.build-and-push.outputs.digest }}
|