forked from BrettMayson/Arma3Server
-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (44 loc) · 1.23 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}