Skip to content

Initial release - Fix CI #2

Initial release - Fix CI

Initial release - Fix CI #2

name: Build and Push Docker Image on Release
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile.zomboid
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/docker-zomboid-server:${{ github.ref_name }}
- name: Tag image with 'latest'
run: |
docker tag ${{ secrets.DOCKER_USERNAME }}/docker-zomboid-server:${{ github.ref_name }} ${{ secrets.DOCKER_USERNAME }}/docker-zomboid-server:latest
docker push ${{ secrets.DOCKER_USERNAME }}/docker-zomboid-server:latest