v3.0.4 #45
Workflow file for this run
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: Docker Release | |
on: | |
release: | |
types: [published] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
max-parallel: 1 | |
matrix: | |
image: [odin, valheim] | |
steps: | |
# Check out the repository | |
- uses: actions/checkout@v4 | |
# Generate Docker metadata | |
- name: Docker meta | |
id: meta | |
uses: crazy-max/ghaction-docker-meta@v5 | |
with: | |
images: | | |
mbround18/${{ matrix.image }} | |
ghcr.io/mbround18/${{ matrix.image }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
# Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Log in to DockerHub | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: mbround18 | |
password: ${{ secrets.DOCKER_TOKEN }} | |
# Log in to GitHub Container Registry | |
- name: Login to GitHub Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
# Install jq for JSON parsing | |
- name: "JQ: Install" | |
run: sudo apt-get install -y jq | |
# Build and push Docker images | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile.${{ matrix.image }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=mbround18/${{ matrix.image }}:buildcache | |
cache-to: type=registry,ref=mbround18/${{ matrix.image }}:buildcache,mode=max | |
build-args: | | |
"GITHUB_SHA=${GITHUB_SHA}" | |
"GITHUB_REF=${GITHUB_REF}" | |
"GITHUB_REPOSITORY=${GITHUB_REPOSITORY}" |