-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Docker builds to publish to ghcr.io & update README
- Loading branch information
1 parent
62c9549
commit 4841c07
Showing
5 changed files
with
77 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,48 +11,50 @@ jobs: | |
matrix: | ||
runner-platform: | ||
- ubuntu-latest | ||
- buildjet-4vcpu-ubuntu-2204-arm | ||
- macos-14 # ARM | ||
include: | ||
- runner-platform: ubuntu-latest | ||
build-arch: linux/amd64 | ||
tagged-platform: amd64 | ||
- runner-platform: buildjet-4vcpu-ubuntu-2204-arm | ||
- runner-platform: macos-14 | ||
build-arch: linux/arm64 | ||
tagged-platform: arm64 | ||
runs-on: ${{ matrix.runner-platform }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Set up Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
# AWS data transfer is pricy | ||
if: ${{ matrix.runner-platform != 'buildjet-4vcpu-ubuntu-2204-arm' }} | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-prs-${{ matrix.build-arch }}-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-prs-${{ matrix.build-arch }} | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- 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 and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: codetheweb/muse:${{ github.sha }}-${{ matrix.tagged-platform }} | ||
tags: | | ||
codetheweb/muse:${{ github.sha }}-${{ matrix.tagged-platform }} | ||
ghcr.io/museofficial/muse:${{ github.sha }}-${{ matrix.tagged-platform }} | ||
platforms: ${{ matrix.build-arch }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=min | ||
build-args: | | ||
COMMIT_HASH=${{ github.sha }} | ||
BUILD_DATE=${{ steps.current-time.outputs.time }} | ||
|
@@ -73,21 +75,37 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Get tags | ||
id: get-tags | ||
- 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 tags (Docker Hub) | ||
id: get-tags-dockerhub | ||
uses: Surgo/docker-smart-tag-action@v1 | ||
with: | ||
docker_image: codetheweb/muse | ||
|
||
- name: Combine tags | ||
run: docker buildx imagetools create $(echo '${{ steps.get-tags.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/muse:${{ github.sha }}-arm64' 'codetheweb/muse:${{ github.sha }}-amd64' | ||
- name: Get tags (ghcr.io) | ||
id: get-tags-ghcr | ||
uses: Surgo/docker-smart-tag-action@v1 | ||
with: | ||
docker_image: codetheweb/muse | ||
|
||
- name: Combine tags (Docker Hub) | ||
run: docker buildx imagetools create $(echo '${{ steps.get-tags-dockerhub.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'codetheweb/muse:${{ github.sha }}-arm64' 'codetheweb/muse:${{ github.sha }}-amd64' | ||
|
||
- name: Combine tags (GitHub Container Registry) | ||
run: docker buildx imagetools create $(echo '${{ steps.get-tags-ghcr.outputs.tag }}' | tr "," "\0" | xargs -0 printf -- '-t %s ') 'ghcr.io/museofficial/muse:${{ github.sha }}-arm64' 'ghcr.io/museofficial/muse:${{ github.sha }}-amd64' | ||
|
||
- name: Update Docker Hub description | ||
uses: peter-evans/[email protected] | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: codetheweb/muse | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
repository: codetheweb/muse | ||
|
||
release: | ||
name: Create GitHub release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "muse", | ||
"version": "2.9.1", | ||
"description": "🎧 a self-hosted Discord music bot that doesn't suck ", | ||
"repository": "[email protected]:codetheweb/muse.git", | ||
"repository": "[email protected]:museofficial/muse.git", | ||
"author": "Max Isom <[email protected]>", | ||
"license": "MIT", | ||
"private": true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters