Build Docker images #1949
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker images | |
on: | |
schedule: | |
- cron: "0 0 * * *" # At 00:00. | |
push: | |
branches: | |
- "master" | |
tags: | |
- "*.*.*" | |
pull_request: | |
branches: | |
- "master" | |
env: | |
REGISTRY: ghcr.io | |
permissions: | |
packages: write | |
jobs: | |
tf2-base-i386: | |
runs-on: ubuntu-latest | |
outputs: | |
tf2-base-i386-tag: ${{ steps.docker_meta.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-base | |
${{ env.REGISTRY }}/melkortf/tf2-base/i386 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-base | |
file: ./packages/tf2-base/i386.Dockerfile | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-base-amd64: | |
runs-on: ubuntu-latest | |
outputs: | |
tf2-base-amd64-tag: ${{ steps.docker_meta.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/melkortf/tf2-base/amd64 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-base | |
file: ./packages/tf2-base/amd64.Dockerfile | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-sourcemod-i386: | |
runs-on: ubuntu-latest | |
needs: tf2-base-i386 | |
outputs: | |
tf2-sourcemod-i386-tag: ${{ steps.docker_meta.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-sourcemod | |
${{ env.REGISTRY }}/melkortf/tf2-sourcemod/i386 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-sourcemod | |
build-args: | | |
ARCH=i386 | |
TF2_BASE_TAG=${{ needs.tf2-base-i386.outputs.tf2-base-i386-tag }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-sourcemod-amd64: | |
runs-on: ubuntu-latest | |
needs: tf2-base-amd64 | |
outputs: | |
tf2-sourcemod-amd64-tag: ${{ steps.docker_meta.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-sourcemod/amd64 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-sourcemod | |
build-args: | | |
ARCH=amd64 | |
TF2_BASE_TAG=${{ needs.tf2-base-amd64.outputs.tf2-base-amd64-tag }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-mge: | |
runs-on: ubuntu-latest | |
needs: tf2-sourcemod-i386 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-mge | |
${{ env.REGISTRY }}/melkortf/tf2-mge/i386 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-mge | |
build-args: | | |
TF2_SOURCEMOD_TAG=${{ needs.tf2-sourcemod-i386.outputs.tf2-sourcemod-i386-tag }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-competitive: | |
runs-on: ubuntu-latest | |
needs: tf2-sourcemod-i386 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-competitive | |
${{ env.REGISTRY }}/melkortf/tf2-competitive/i386 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-competitive | |
build-args: | | |
TF2_SOURCEMOD_TAG=${{ needs.tf2-sourcemod-i386.outputs.tf2-sourcemod-i386-tag }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 | |
tf2-dm: | |
runs-on: ubuntu-latest | |
needs: tf2-sourcemod-i386 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.REGISTRY }}/melkortf/tf2-dm | |
${{ env.REGISTRY }}/melkortf/tf2-dm/i386 | |
tags: | | |
type=sha,format=long | |
type=schedule,pattern=nightly | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./packages/tf2-dm | |
build-args: | | |
TF2_SOURCEMOD_TAG=${{ needs.tf2-sourcemod-i386.outputs.tf2-sourcemod-i386-tag }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: true | |
platforms: linux/amd64 |