-
-
Notifications
You must be signed in to change notification settings - Fork 25
80 lines (69 loc) · 2.24 KB
/
Copy path_build-linux.yml
File metadata and controls
80 lines (69 loc) · 2.24 KB
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
70
71
72
73
74
75
76
77
78
79
80
name: Build Linux Image Template
on:
workflow_call:
inputs:
name:
type: string
required: true
description: "Name of main tag and workflow file."
tags:
type: string
required: false
description: "Extra tags to use besides main tag."
env:
DKR_ORG: steamcmd
GH_ORG: steamcmd
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install GOSS
uses: e1himself/goss-installation-action@v1
with:
version: "v0.4.9"
- name: Log into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
registry: docker.io
- name: Log into Github Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.GHCRIO_USERNAME }}
password: ${{ secrets.GHCRIO_ACCESS_TOKEN }}
registry: ghcr.io
- name: Build the docker image
uses: docker/build-push-action@v6
with:
context: ./dockerfiles/${{ inputs.name }}
file: ./dockerfiles/${{ inputs.name }}/Dockerfile
platforms: linux/amd64
load: true
push: false
tags: steamcmd:${{ inputs.name }}
- name: Run static test on Docker image
run: dgoss run steamcmd:${{ inputs.name }} --entrypoint=""
# master
- name: Tag image
run: >
for TAG in ${{ inputs.tags }} ${{ inputs.name }};
do
docker tag steamcmd:${{ inputs.name }} docker.io/${{ env.DKR_ORG }}/steamcmd:${TAG};
docker tag steamcmd:${{ inputs.name }} ghcr.io/${{ env.GH_ORG }}/steamcmd:${TAG};
done
- name: Push image
run: |
docker push docker.io/${{ env.DKR_ORG }}/steamcmd --all-tags
docker push ghcr.io/${{ env.GH_ORG }}/steamcmd --all-tags
if: ${{ github.ref == 'refs/heads/master' }}