Skip to content

Update publish.yml

Update publish.yml #79

Workflow file for this run

name: Publish Image
on:
workflow_dispatch:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
-
name: Checkout repo
uses: actions/checkout@master
-
name: Build image tag
run: echo "IMAGE_TAG=$(git log -1 --pretty=%h)" >> $GITHUB_ENV
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: |
mylesagray/arma3-server:${{ env.IMAGE_TAG }}
mylesagray/arma3-server:latest
ghcr.io/mylesagray/arma3-server:${{ env.IMAGE_TAG }}
ghcr.io/mylesagray/arma3-server:latest
file: ./Dockerfile
build-args: |
IMAGE_TAG=${{ env.IMAGE_TAG }}