-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (59 loc) · 1.63 KB
/
docker-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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: push image
on:
schedule:
- cron: '0 0 * * 1'
push:
tags:
- '*'
workflow_dispatch:
env:
IMAGE_NAME: dobolinux/iw4x-server
IMAGE_VERSION: "1.1"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
- uses: actions/checkout@v3
- name: Log into registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: set release date
run: |
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.IMAGE_NAME }}
tags: |
latest
${{ env.IMAGE_VERSION }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3.0.0
with:
context: ./image
push: true
tags: '${{ steps.meta.outputs.tags }}'
build-args: |
BUILD_DATE=${{env.RELEASE_DATE }}
VERSION=${{ env.IMAGE_VERSION }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.IMAGE_NAME }}
readme-filepath: ./README.md
short-description: "Container for iw4x (MW2) server"