2023-08-25 02:13:03 +00:00
|
|
|
name: "Yuzu Rooms Docker Image CI"
|
2022-09-13 00:53:49 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-08-25 02:13:03 +00:00
|
|
|
branches: ["*"]
|
|
|
|
tags: ["*"]
|
2022-09-13 00:53:49 +00:00
|
|
|
pull_request:
|
2023-08-25 02:13:03 +00:00
|
|
|
branches: [master]
|
2022-09-13 00:53:49 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs: {}
|
|
|
|
schedule:
|
2023-08-25 02:13:03 +00:00
|
|
|
- cron: "0 7 * * 0"
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY_IMAGE: yuzuemu/yuzu-multiplayer-dedicated
|
2022-09-13 00:53:49 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2023-08-25 02:13:03 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform:
|
|
|
|
- linux/amd64
|
|
|
|
- linux/arm64
|
2022-09-13 00:53:49 +00:00
|
|
|
steps:
|
2024-02-12 06:14:42 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-25 02:13:03 +00:00
|
|
|
- name: Create Docker Image Label
|
|
|
|
id: meta
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/metadata-action@v5
|
2023-08-25 02:13:03 +00:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY_IMAGE }}
|
2023-09-07 02:47:15 +00:00
|
|
|
tags: type=raw,value=latest,enable={{is_default_branch}}
|
2022-09-13 00:53:49 +00:00
|
|
|
- name: Set up QEMU
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-09-13 00:53:49 +00:00
|
|
|
- name: Set up Docker BuildX
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-09-13 00:53:49 +00:00
|
|
|
- name: Login to DockerHub
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/login-action@v3
|
2022-09-13 00:53:49 +00:00
|
|
|
if: (github.ref == 'refs/heads/master') && (github.repository == 'yuzu-emu/yuzu-multiplayer-dedicated')
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build Image
|
2023-08-25 02:13:03 +00:00
|
|
|
id: build
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2022-09-13 00:53:49 +00:00
|
|
|
with:
|
2023-08-25 02:13:03 +00:00
|
|
|
platforms: ${{ matrix.platform }}
|
2022-09-13 00:53:49 +00:00
|
|
|
push: ${{ (github.ref == 'refs/heads/master') && (github.repository == 'yuzu-emu/yuzu-multiplayer-dedicated') }}
|
2023-08-25 02:13:03 +00:00
|
|
|
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true
|
|
|
|
- name: Export digest
|
|
|
|
run: |
|
|
|
|
mkdir -p /tmp/digests
|
|
|
|
digest="${{ steps.build.outputs.digest }}"
|
2024-02-27 05:35:21 +00:00
|
|
|
cache_name="digests-${{ matrix.platform }}"
|
|
|
|
echo "CACHE_NAME=${cache_name/\//-}" >> $GITHUB_ENV
|
2023-08-25 02:13:03 +00:00
|
|
|
touch "/tmp/digests/${digest#sha256:}"
|
|
|
|
- name: Upload digest
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-25 02:13:03 +00:00
|
|
|
with:
|
2024-02-27 05:35:21 +00:00
|
|
|
name: ${{ env.CACHE_NAME }}
|
2023-08-25 02:13:03 +00:00
|
|
|
path: /tmp/digests/*
|
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 1
|
|
|
|
upload:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: (github.ref == 'refs/heads/master') && (github.repository == 'yuzu-emu/yuzu-multiplayer-dedicated')
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
steps:
|
|
|
|
- name: Download digests
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2023-08-25 02:13:03 +00:00
|
|
|
with:
|
2024-02-27 05:35:21 +00:00
|
|
|
pattern: digests-*
|
2023-08-25 02:13:03 +00:00
|
|
|
path: /tmp/digests
|
2024-02-27 05:35:21 +00:00
|
|
|
merge-multiple: true
|
2023-08-25 02:13:03 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-08-25 02:13:03 +00:00
|
|
|
- name: Create Docker Image Label
|
|
|
|
id: meta
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/metadata-action@v5
|
2023-08-25 02:13:03 +00:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY_IMAGE }}
|
2023-09-07 02:57:43 +00:00
|
|
|
tags: type=raw,value=latest,enable={{is_default_branch}}
|
2023-08-25 02:13:03 +00:00
|
|
|
- name: Login to Docker Hub
|
2024-02-12 06:14:42 +00:00
|
|
|
uses: docker/login-action@v3
|
2023-08-25 02:13:03 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Create manifest list and push
|
|
|
|
working-directory: /tmp/digests
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
|
|
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
|
|
|
|
- name: Inspect image
|
|
|
|
run: |
|
|
|
|
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
|