Skip to content

Workflow file for this run

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'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch:
- steam_legacy
- public
mod:
- valve
- cstrike
- czero
- dod
- gearbox
- tfc
- ricochet
- dmc
exclude:
- mod: dod
branch: steam_legacy
- mod: gearbox
branch: steam_legacy
- mod: tfc
branch: steam_legacy
- mod: ricochet
branch: steam_legacy
- mod: dmc
branch: steam_legacy
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:
image: ${{ vars.DOCKER_USERNAME }}/${{ matrix.mod }}
is_public: ${{ matrix.branch == 'public' }}
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ env.needToPush }}
tags: |
${{ env.image }}:${{ matrix.branch }}
${{ env.is_public && env.image }}${{ env.is_public && ':latest' }}
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 }}