Skip to content

Updated github actions for docker build versioning #36

Updated github actions for docker build versioning

Updated github actions for docker build versioning #36

Workflow file for this run

name: Publish DockerHub image
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- 'main'
jobs:
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.repository_owner }}/projectzomboid-server
tags: |

Check failure on line 26 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Publish DockerHub image

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 26, Col: 17): Unrecognized named-value: 'git'. Located at position 1 within expression: git describe --tags --abbrev=0
type=semver,pattern={{version}},value=${{ git describe --tags --abbrev=0 }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/projectzomboid-server
readme-filepath: ./readme.md
short-description: Project Zomboid Server Docker Image