mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-27 09:12:43 +02:00
Update Docker builds to publish to ghcr.io & update README (#1067)
This commit is contained in:
parent
62c954943d
commit
e494287d1d
7 changed files with 218 additions and 125 deletions
86
.github/workflows/pr-snapshot.yml
vendored
Normal file
86
.github/workflows/pr-snapshot.yml
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
name: Build snapshot of PR
|
||||
|
||||
on: pull_request
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: ghcr.io/museofficial/muse
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build snapshot
|
||||
strategy:
|
||||
matrix:
|
||||
runner-platform:
|
||||
- ubuntu-latest
|
||||
- namespace-profile-default-arm64
|
||||
include:
|
||||
- runner-platform: ubuntu-latest
|
||||
build-arch: linux/amd64
|
||||
tagged-platform: amd64
|
||||
- runner-platform: namespace-profile-default-arm64
|
||||
build-arch: linux/arm64
|
||||
tagged-platform: arm64
|
||||
runs-on: ${{ matrix.runner-platform }}
|
||||
steps:
|
||||
- name: Prepare
|
||||
run: |
|
||||
platform=${{ matrix.build-arch }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: type=ref,event=pr
|
||||
|
||||
- name: Set up Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get current time
|
||||
uses: josStorer/get-current-time@v2
|
||||
id: current-time
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
outputs: type=docker,dest=/tmp/image.tar
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
platforms: ${{ matrix.build-arch }}
|
||||
build-args: |
|
||||
COMMIT_HASH=${{ github.sha }}
|
||||
BUILD_DATE=${{ steps.current-time.outputs.time }}
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload image
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: image-${{ env.PLATFORM_PAIR }}
|
||||
path: /tmp/image.tar
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
- name: Save PR number in artifact
|
||||
shell: bash
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
run: echo $PR_NUMBER > /tmp/pull_request_number.txt
|
||||
- name: Upload PR number
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pull_request_number
|
||||
path: /tmp/pull_request_number.txt
|
||||
overwrite: true
|
Loading…
Add table
Add a link
Reference in a new issue