Skip to content

Docker Release

Docker Release #2

Workflow file for this run

on:
workflow_dispatch:
push:
tags:
- '*'
env:
IMAGE_NAME: mbround18/palworld-docker
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: mbround18
password: ${{ secrets.DOCKER_TOKEN }}
- name: Get the version
id: vars
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
- name: Build ${{ env.IMAGE_NAME }}
id: docker_build
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
build-args: |
"GITHUB_SHA=${GITHUB_SHA}"
"GITHUB_REF=${GITHUB_REF}"
"GITHUB_REPOSITORY=${GITHUB_REPOSITORY}"
"ODIN_IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"