Skip to content

Docker Build

Docker Build #1

Workflow file for this run

name: Docker Build
on:
workflow_run:
workflows: ["Linux GitHub CI"]
types:
- completed
jobs:
build-docker:
if: >
github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'ghaction-docker')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# The checkout action is required to access the repository files,
# including the Dockerfile.
# It needs to checkout the specific commit that triggered the 'Linux GitHub CI' workflow.
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/gn-image/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/geonetwork:${{ github.event.workflow_run.head_branch }}