Skip to content

Docker Image CI

Docker Image CI #105

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
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
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ env.needToPush }}
tags: |
${{ vars.DOCKER_USERNAME }}/${{ matrix.mod }}:${{ matrix.branch }}
${{ matrix.branch == 'public' && format('{0}/{1}:latest', vars.DOCKER_USERNAME, matrix.mod) || 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 }}