Skip to content

upstream_image_update #328

upstream_image_update

upstream_image_update #328

Workflow file for this run

name: build
on:
push:
branches:
- master
paths:
- Dockerfile
- .github/workflows/build.yml
- root/**
pull_request:
branches:
- master
paths:
- Dockerfile
- .github/workflows/build.yml
- root/**
repository_dispatch:
types:
- upstream_image_update
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
env:
TITLE: Red-DiscordBot
GHCR_SLUG: ghcr.io/phasecorex/red-discordbot
DOCK_SLUG: docker.io/phasecorex/red-discordbot
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_SLUG }}
${{ env.DOCK_SLUG }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.vendor=${{ github.repository_owner }}
org.opencontainers.image.title=${{ env.TITLE }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push extra-audio
uses: docker/build-push-action@v6
with:
target: extra-audio
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:full-py311
${{ env.DOCK_SLUG }}:full-py311
${{ env.GHCR_SLUG }}:full
${{ env.DOCK_SLUG }}:full
${{ env.GHCR_SLUG }}:extra-audio-py311
${{ env.DOCK_SLUG }}:extra-audio-py311
${{ env.GHCR_SLUG }}:extra-audio
${{ env.DOCK_SLUG }}:extra-audio
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:extra-audio
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push core
uses: docker/build-push-action@v6
with:
target: core
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:noaudio-py311
${{ env.DOCK_SLUG }}:noaudio-py311
${{ env.GHCR_SLUG }}:noaudio
${{ env.DOCK_SLUG }}:noaudio
${{ env.GHCR_SLUG }}:core-py311
${{ env.DOCK_SLUG }}:core-py311
${{ env.GHCR_SLUG }}:core
${{ env.DOCK_SLUG }}:core
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:extra-audio
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push extra
uses: docker/build-push-action@v6
with:
target: extra
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:extra-py311
${{ env.DOCK_SLUG }}:extra-py311
${{ env.GHCR_SLUG }}:extra
${{ env.DOCK_SLUG }}:extra
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:extra-audio
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push core-audio
uses: docker/build-push-action@v6
with:
target: core-audio
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:audio-py311
${{ env.DOCK_SLUG }}:audio-py311
${{ env.GHCR_SLUG }}:audio
${{ env.DOCK_SLUG }}:audio
${{ env.GHCR_SLUG }}:core-audio-py311
${{ env.DOCK_SLUG }}:core-audio-py311
${{ env.GHCR_SLUG }}:core-audio
${{ env.DOCK_SLUG }}:core-audio
${{ env.GHCR_SLUG }}:latest
${{ env.DOCK_SLUG }}:latest
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:core
${{ env.GHCR_SLUG }}:core-audio
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push core-pylav
uses: docker/build-push-action@v6
with:
target: core-pylav
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:pylav
${{ env.DOCK_SLUG }}:pylav
${{ env.GHCR_SLUG }}:core-pylav
${{ env.DOCK_SLUG }}:core-pylav
${{ env.GHCR_SLUG }}:latest-pylav
${{ env.DOCK_SLUG }}:latest-pylav
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:core-audio
${{ env.GHCR_SLUG }}:core-pylav
labels: ${{ steps.meta.outputs.labels }}
-
name: Build and push extra-pylav
uses: docker/build-push-action@v6
with:
target: extra-pylav
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_SLUG }}:full-pylav
${{ env.DOCK_SLUG }}:full-pylav
${{ env.GHCR_SLUG }}:extra-pylav
${{ env.DOCK_SLUG }}:extra-pylav
build-args: |
PCX_DISCORDBOT_BUILD=${{ github.run_id }}
PCX_DISCORDBOT_COMMIT=${{ github.sha }}
cache-from: |
${{ env.GHCR_SLUG }}:extra-audio
${{ env.GHCR_SLUG }}:core-pylav
${{ env.GHCR_SLUG }}:extra-pylav
labels: ${{ steps.meta.outputs.labels }}
-
name: Check manifest
if: github.event_name != 'pull_request'
run: |
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:core
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:extra
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:core-audio
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:extra-audio
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:core-pylav
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:extra-pylav
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:core
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:extra
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:core-audio
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:extra-audio
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:core-pylav
docker buildx imagetools inspect ${{ env.DOCK_SLUG }}:extra-pylav
-
name: Check pull
if: github.event_name != 'pull_request'
run: |
docker pull ${{ env.GHCR_SLUG }}:core
docker pull ${{ env.GHCR_SLUG }}:extra
docker pull ${{ env.GHCR_SLUG }}:core-audio
docker pull ${{ env.GHCR_SLUG }}:extra-audio
docker pull ${{ env.GHCR_SLUG }}:core-pylav
docker pull ${{ env.GHCR_SLUG }}:extra-pylav
docker image inspect ${{ env.GHCR_SLUG }}:core
docker image inspect ${{ env.GHCR_SLUG }}:extra
docker image inspect ${{ env.GHCR_SLUG }}:core-audio
docker image inspect ${{ env.GHCR_SLUG }}:extra-audio
docker image inspect ${{ env.GHCR_SLUG }}:core-pylav
docker image inspect ${{ env.GHCR_SLUG }}:extra-pylav
docker pull ${{ env.DOCK_SLUG }}:core
docker pull ${{ env.DOCK_SLUG }}:extra
docker pull ${{ env.DOCK_SLUG }}:core-audio
docker pull ${{ env.DOCK_SLUG }}:extra-audio
docker pull ${{ env.DOCK_SLUG }}:core-pylav
docker pull ${{ env.DOCK_SLUG }}:extra-pylav
docker image inspect ${{ env.DOCK_SLUG }}:core
docker image inspect ${{ env.DOCK_SLUG }}:extra
docker image inspect ${{ env.DOCK_SLUG }}:core-audio
docker image inspect ${{ env.DOCK_SLUG }}:extra-audio
docker image inspect ${{ env.DOCK_SLUG }}:core-pylav
docker image inspect ${{ env.DOCK_SLUG }}:extra-pylav