-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (57 loc) · 1.66 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
name: Docker Image CI
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '.vscode/**'
- '.github/workflows/dockerhub-description.yml'
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
env:
DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PLATFORMS: linux/amd64
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- steam_legacy
- public
mod:
- valve
- cstrike
steps:
- uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Cache Docker layers
uses: actions/[email protected]
env:
KEY: ${{ matrix.mod }}-${{ matrix.branch }}
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ env.KEY }}
restore-keys: ${{ runner.os }}-buildx-${{ env.KEY }}
- name: Log in to Docker Hub
if: github.ref == 'refs/heads/master'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: ${{ env.DOCKER_PLATFORMS }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ secrets.DOCKER_USERNAME }}/${{ matrix.mod }}:${{ matrix.branch }}
build-args: |
APPBRANCH=${{ matrix.branch }}
MOD=${{ matrix.mod }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache