2024-10-13 11:22:16 +00:00
|
|
|
# Based on https://github.com/riscv/riscv-docs-base-container-image/blob/main/.github/workflows/build.yaml
|
|
|
|
name: Build and publish custom Asciidoctor image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
paths:
|
|
|
|
- "docker/Dockerfile"
|
2024-10-13 13:13:05 +00:00
|
|
|
- ".gitea/workflows/image.yaml"
|
2024-10-13 11:22:16 +00:00
|
|
|
|
2024-10-13 13:27:04 +00:00
|
|
|
env:
|
|
|
|
DOCKER_IMG: docker-asciidoctor-wavedrom
|
|
|
|
|
2024-10-13 11:22:16 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build and push to Container Registry
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to Gitea Container Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
2024-10-13 13:13:05 +00:00
|
|
|
registry: ${{ vars.CONTAINER_REGISTRY_URL }}
|
|
|
|
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
|
2024-10-13 11:22:16 +00:00
|
|
|
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get Current Date
|
|
|
|
run: echo "NOW=$(date +'%m%d%Y')" >> "$GITEA_ENV"
|
|
|
|
|
|
|
|
- name: Build image and push to Docker Hub
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: ./docker
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
tags: |
|
2024-10-13 13:27:04 +00:00
|
|
|
${{ vars.CONTAINER_REGISTRY_URL }}/${{ env.DOCKER_IMG }}:${{ gitea.sha }}
|
|
|
|
${{ vars.CONTAINER_REGISTRY_URL }}/${{ env.DOCKER_IMG }}:latest
|
2024-10-13 11:22:16 +00:00
|
|
|
push: true
|