docker-quake2-yamagi/.gitea/workflows/build.yaml

399 lines
19 KiB
YAML

# SPDX-FileCopyrightText: 2023 - 2024 Daniel Wolf <nephatrine@gmail.com>
#
# SPDX-License-Identifier: ISC
name: Build Container Image
run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }}
on:
push:
schedule:
- cron: '40 19 * * 3'
jobs:
build_amd64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/amd64
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/amd64:quake2-yamagi
cache-from: type=registry,ref=code.nephatrine.net/nephnet/amd64-cache:quake2-yamagi
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/amd64-cache:quake2-yamagi,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/quake2-yamagi:${BRANCH}-amd64 --platform linux/amd64 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (X86_64; 8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/amd64:quake2-yamagi --platform linux/amd64
docker tag code.nephatrine.net/nephnet/amd64:quake2-yamagi nephatrine/amd64:quake2-yamagi
docker rmi code.nephatrine.net/nephnet/amd64:quake2-yamagi
docker push nephatrine/amd64:quake2-yamagi
docker rmi nephatrine/amd64:quake2-yamagi
build_i386:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-i386
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/386
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/i386:quake2-yamagi
cache-from: type=registry,ref=code.nephatrine.net/nephnet/i386-cache:quake2-yamagi
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/i386-cache:quake2-yamagi,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/quake2-yamagi:${BRANCH}-i386 --platform linux/386 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (I686; 8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_i386:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_i386]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/i386:quake2-yamagi --platform linux/386
docker tag code.nephatrine.net/nephnet/i386:quake2-yamagi nephatrine/ia32:quake2-yamagi
docker rmi code.nephatrine.net/nephnet/i386:quake2-yamagi
docker push nephatrine/ia32:quake2-yamagi
docker rmi nephatrine/ia32:quake2-yamagi
build_arm64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/arm64/v8
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/arm64:quake2-yamagi
cache-from: type=registry,ref=code.nephatrine.net/nephnet/arm64-cache:quake2-yamagi
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/arm64-cache:quake2-yamagi,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/quake2-yamagi:${BRANCH}-arm64 --platform linux/arm64/v8 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (AARCH64; 8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_arm64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_arm64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/arm64:quake2-yamagi --platform linux/arm64/v8
docker tag code.nephatrine.net/nephnet/arm64:quake2-yamagi nephatrine/arm64:quake2-yamagi
docker rmi code.nephatrine.net/nephnet/arm64:quake2-yamagi
docker push nephatrine/arm64:quake2-yamagi
docker rmi nephatrine/arm64:quake2-yamagi
build_armhf:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-armhf
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/arm/v7
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/armv7:quake2-yamagi
cache-from: type=registry,ref=code.nephatrine.net/nephnet/armv7-cache:quake2-yamagi
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/armv7-cache:quake2-yamagi,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/quake2-yamagi:${BRANCH}-armv7 --platform linux/arm/v7 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (ARMV7L; 8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_armhf:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_armhf]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/armv7:quake2-yamagi --platform linux/arm/v7
docker tag code.nephatrine.net/nephnet/armv7:quake2-yamagi nephatrine/armv7:quake2-yamagi
docker rmi code.nephatrine.net/nephnet/armv7:quake2-yamagi
docker push nephatrine/armv7:quake2-yamagi
docker rmi nephatrine/armv7:quake2-yamagi
build_riscv64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-riscv64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/riscv64
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/riscv64:quake2-yamagi
cache-from: type=registry,ref=code.nephatrine.net/nephnet/riscv64-cache:quake2-yamagi
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/riscv64-cache:quake2-yamagi,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/quake2-yamagi:${BRANCH}-riscv64 --platform linux/riscv64 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (RISCV64; 8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_riscv64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_riscv64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/riscv64:quake2-yamagi --platform linux/riscv64
docker tag code.nephatrine.net/nephnet/riscv64:quake2-yamagi nephatrine/riscv64:quake2-yamagi
docker rmi code.nephatrine.net/nephnet/riscv64:quake2-yamagi
docker push nephatrine/riscv64:quake2-yamagi
docker rmi nephatrine/riscv64:quake2-yamagi
build:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64, build_i386, build_arm64, build_armhf, build_riscv64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create code.nephatrine.net/nephnet/quake2-yamagi:8.30 --amend code.nephatrine.net/nephnet/amd64:quake2-yamagi --amend code.nephatrine.net/nephnet/i386:quake2-yamagi --amend code.nephatrine.net/nephnet/arm64:quake2-yamagi --amend code.nephatrine.net/nephnet/armv7:quake2-yamagi --amend code.nephatrine.net/nephnet/riscv64:quake2-yamagi
docker manifest create code.nephatrine.net/nephnet/quake2-yamagi:8 --amend code.nephatrine.net/nephnet/amd64:quake2-yamagi --amend code.nephatrine.net/nephnet/i386:quake2-yamagi --amend code.nephatrine.net/nephnet/arm64:quake2-yamagi --amend code.nephatrine.net/nephnet/armv7:quake2-yamagi --amend code.nephatrine.net/nephnet/riscv64:quake2-yamagi
docker manifest create code.nephatrine.net/nephnet/quake2-yamagi:latest --amend code.nephatrine.net/nephnet/amd64:quake2-yamagi --amend code.nephatrine.net/nephnet/i386:quake2-yamagi --amend code.nephatrine.net/nephnet/arm64:quake2-yamagi --amend code.nephatrine.net/nephnet/armv7:quake2-yamagi --amend code.nephatrine.net/nephnet/riscv64:quake2-yamagi
docker manifest push --purge code.nephatrine.net/nephnet/quake2-yamagi:8.30
docker manifest push --purge code.nephatrine.net/nephnet/quake2-yamagi:8
docker manifest push --purge code.nephatrine.net/nephnet/quake2-yamagi:latest
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (8.30)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
push:
needs: [push_amd64, push_i386, push_arm64, push_armhf, push_riscv64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: |
docker manifest create nephatrine/quake2-server:yamagi-8.30 --amend nephatrine/amd64:quake2-yamagi --amend nephatrine/ia32:quake2-yamagi --amend nephatrine/arm64:quake2-yamagi --amend nephatrine/armv7:quake2-yamagi --amend nephatrine/riscv64:quake2-yamagi
docker manifest create nephatrine/quake2-server:yamagi-8 --amend nephatrine/amd64:quake2-yamagi --amend nephatrine/ia32:quake2-yamagi --amend nephatrine/arm64:quake2-yamagi --amend nephatrine/armv7:quake2-yamagi --amend nephatrine/riscv64:quake2-yamagi
docker manifest create nephatrine/quake2-server:yamagi --amend nephatrine/amd64:quake2-yamagi --amend nephatrine/ia32:quake2-yamagi --amend nephatrine/arm64:quake2-yamagi --amend nephatrine/armv7:quake2-yamagi --amend nephatrine/riscv64:quake2-yamagi
docker manifest create nephatrine/quake2-server:latest --amend nephatrine/amd64:quake2-yamagi --amend nephatrine/ia32:quake2-yamagi --amend nephatrine/arm64:quake2-yamagi --amend nephatrine/armv7:quake2-yamagi --amend nephatrine/riscv64:quake2-yamagi
docker manifest push --purge nephatrine/quake2-server:yamagi-8.30
docker manifest push --purge nephatrine/quake2-server:yamagi-8
docker manifest push --purge nephatrine/quake2-server:yamagi
docker manifest push --purge nephatrine/quake2-server:latest
- name: Notify Discord
if: gitea.event_name != 'schedule'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: quake2-server (YAMAGI-8.30)"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/quake2-server/general).\nPull `nephatrine/quake2-server:yamagi` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
update_readme:
needs: [push]
runs-on: nephnet
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: Docker Describe
uses: https://github.com/peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: nephatrine/quake2-server