-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (65 loc) · 1.89 KB
/
CI.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
70
71
72
73
name: Docker Image CI
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '.vscode/**'
- '.github/workflows/dockerhub-description.yml'
pull_request:
workflow_dispatch:
schedule:
- cron: '0 1 * * 0'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
mod:
- valve
- cstrike
tagName:
- legacy
- regamedll
- bugfixedhl
exclude:
- mod: valve
tagName: regamedll
- mod: cstrike
tagName: bugfixedhl
# - czero
# - dod
# - gearbox
# - tfc
# - ricochet
# - dmc
env:
needToPush: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/[email protected]
- uses: docker/[email protected]
- name: Log in to Docker Hub
if: ${{ env.needToPush }}
uses: docker/[email protected]
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/[email protected]
env:
rehldsVersion: latest
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: |
${{ vars.DOCKER_USERNAME }}/rehlds-${{ matrix.mod }}:${{ matrix.tagName }}
# ${{ matrix.tagName == 'legacy' && format('{0}/rehlds-{1}:latest', vars.DOCKER_USERNAME, matrix.mod) || null}}
build-args: |
MOD=${{ matrix.mod }}
ReHLDS_VERSION=${{ env.rehldsVersion }}
${{ matrix.tagName != 'legacy' && 'ReGameDLL_VERSION=latest' || '' }}
${{ matrix.tagName == 'legacy' && 'BugfixedHL_LINK=' }}
cache-from: type=gha,scope=build-${{ matrix.mod }}-${{ matrix.mod }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.mod }}-${{ matrix.mod }}