Skip to content

v2.1.3

v2.1.3 #31

Workflow file for this run

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:
- uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v4
with:
# list of Docker images to use as base name for tags
images: |
mbround18/${{ matrix.image }}
ghcr.io/mbround18/${{ matrix.image }}
# generate Docker tags based on the following events/attributes
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
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: mbround18
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
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}"