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

255 lines
12 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' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
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: 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
tags: code.nephatrine.net/nephnet/quake2-yamagi:latest-amd64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-amd64,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}-latest-amd64 --platform linux/amd64 ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (X86_64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_i386:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-i386
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: 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
tags: code.nephatrine.net/nephnet/quake2-yamagi:latest-i386
cache-from: type=registry,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-i386
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-i386,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}-latest-i386 --platform linux/386 ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (I686)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_arm64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
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: 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
tags: code.nephatrine.net/nephnet/quake2-yamagi:latest-arm64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-arm64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-arm64,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}-latest-arm64 --platform linux/arm64/v8 ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (AARCH64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_armhf:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-armhf
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: 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
tags: code.nephatrine.net/nephnet/quake2-yamagi:latest-armv7
cache-from: type=registry,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-armv7
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-armv7,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}-latest-armv7 --platform linux/arm/v7 ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (ARMV7L)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_riscv64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-riscv64
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: 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
tags: code.nephatrine.net/nephnet/quake2-yamagi:latest-riscv64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-riscv64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/quake2-yamagi-cache:latest-riscv64,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}-latest-riscv64 --platform linux/riscv64 ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (RISCV64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_manifest:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64, build_i386, build_arm64, build_armhf, build_riscv64]
runs-on: nephnet-amd64
steps:
- name: Check Base Image
if: gitea.event_name == 'schedule'
uses: https://github.com/lucacome/docker-image-update-checker@v1
id: checkbase
with:
base-image: code.nephatrine.net/nephnet/alpine-s6:internal
image: nephatrine/quake2-server:yamagi
platforms: linux/amd64
- 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 Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: docker buildx imagetools create -t code.nephatrine.net/nephnet/quake2-yamagi:latest -t nephatrine/quake2-server:latest -t nephatrine/quake2-server:yamagi -t nephatrine/quake2-server:yamagi-8.30 -t nephatrine/quake2-server:yamagi-8 code.nephatrine.net/nephnet/quake2-yamagi:latest-amd64 code.nephatrine.net/nephnet/quake2-yamagi:latest-i386 code.nephatrine.net/nephnet/quake2-yamagi:latest-arm64 code.nephatrine.net/nephnet/quake2-yamagi:latest-armv7 code.nephatrine.net/nephnet/quake2-yamagi:latest-riscv64
- name: Notify Discord
if: gitea.event_name != 'schedule' || steps.checkbase.outputs.needs-updating == 'true'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: quake2-server"
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 }}
- 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
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}