testdemos/.github/workflows/Build.yml
Sergey Shorokhov 670c0e714f
Init (#1)
* init

* add gitignore

* Use `debian:stable` tag

* Make compability with `s1lentq/testdemos:latest` image

* Clear APT cache

* Use `wine32` only and remove `wineboot` command

* remove any `*64.dll` and add ability to remove all `*.bsp`

* add CI

* Add `CODEOWNERS`
2024-09-24 01:14:28 +03:00

62 lines
1.5 KiB
YAML

name: Docker Image CI
on:
push:
branches: [ master ]
paths-ignore:
- '**.md'
- '.vscode/**'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- steam_legacy
- public
mod:
# - valve
- cstrike
# - czero
# - dod
# - gearbox
# - tfc
# - ricochet
# - dmc
env:
needToPush: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4.1.1
- uses: docker/setup-buildx-action@v3.2.0
- name: Log in to Docker Hub
if: ${{ env.needToPush }}
uses: docker/login-action@v3.1.0
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v5.3.0
env:
OWNER: ${{ vars.DOCKER_USERNAME }}
REPO: ${{ vars.DOCKER_REPOSITORY }}
TAG: ${{ matrix.branch }}
with:
context: .
file: ./Dockerfile
push: ${{ env.needToPush }}
tags: |
${{ env.OWNER }}/${{ env.REPO }}:${{ env.TAG }}
${{ env.TAG == 'steam_legacy' && format('{0}/{1}:latest', env.OWNER, env.REPO) || null}}
build-args: |
APPBRANCH=${{ matrix.branch }}
MOD=${{ matrix.mod }}
cache-from: type=gha,scope=build-${{ matrix.mod }}-${{ matrix.branch }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.mod }}-${{ matrix.branch }}