test: Remove Docker experimental on tests #310
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: Publish Docker image | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "./**/*.md" | |
- "docs/" | |
- "social/" | |
- ".editorconfig" | |
- ".gitignore" | |
- ".shellcheckrc" | |
- "compose.yml" | |
- "LICENSE" | |
- "Makefile" | |
release: | |
types: | |
- published | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
PLATFORMS: linux/amd64,linux/arm64 | |
EXTRA_REGISTRIES: ghcr.io quay.io | |
jobs: | |
metadata: | |
name: Metadata | |
runs-on: ubuntu-latest | |
outputs: | |
tags: ${{ steps.tags.outputs.tags }} | |
vcs_ref: ${{ steps.vcs_ref.outputs.vcs_ref }} | |
created_on: ${{ steps.created_on.outputs.created_on }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Image Tags | |
id: tags | |
run: | | |
IMAGE_TAG="${{ github.event.release.tag_name }}" | |
[[ -z "${IMAGE_TAG}" ]] && IMAGE_TAG='latest' | |
DOCKER_IMAGE="${IMAGE_NAME}:${IMAGE_TAG}" | |
TAGS="${DOCKER_IMAGE}" | |
for registry in ${EXTRA_REGISTRIES}; do | |
TAGS="${TAGS},${registry}/${DOCKER_IMAGE}" | |
done | |
echo "Image Tag: '${IMAGE_TAG}'" | |
echo "Docker image: '${DOCKER_IMAGE}'" | |
echo "Tags: ${TAGS}" | |
echo "tags=${TAGS}" >> $GITHUB_OUTPUT | |
- name: VCS ref | |
id: vcs_ref | |
run: | | |
VCS_REF="${GITHUB_SHA::8}" | |
echo "VCS ref: ${VCS_REF}" | |
echo "vcs_ref=${VCS_REF}" >> $GITHUB_OUTPUT | |
- name: Created On | |
id: created_on | |
run: | | |
CREATED_ON="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" | |
echo "Created on: ${CREATED_ON}" | |
echo "created_on=${CREATED_ON}" >> $GITHUB_OUTPUT | |
- name: Dump environment | |
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == true | |
run: env | sort | |
- name: Dump GitHub context | |
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == true | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "${GITHUB_CONTEXT}" | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: metadata | |
if: contains(toJSON(github.event.commits.*.message), 'ci(debug)') == false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Container Registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Login to Quay.io Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAYIO_USERNAME }} | |
password: ${{ secrets.QUAYIO_PASSWORD }} | |
- name: Build | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: ${{ env.PLATFORMS }} | |
build-args: | | |
VCS_REF=${{ needs.metadata.outputs.vcs_ref }} | |
BUILD_DATE=${{ needs.metadata.outputs.created_on }} | |
outputs: | | |
type=image,annotation-index.org.opencontainers.image.description=https://github.com/${{ github.repository }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
pull: true | |
push: true | |
tags: ${{ needs.metadata.outputs.tags }} |