Change docker registry to ghcr.io

This commit is contained in:
Maschell 2023-04-01 07:42:58 +02:00
parent aa469e5fa3
commit 001c0f4628
5 changed files with 41 additions and 31 deletions

View File

@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: clang-format - name: clang-format
run: | run: |
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
build-lib: build-lib:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: clang-format needs: clang-format

View File

@ -3,31 +3,41 @@ on:
push: push:
branches: branches:
- main - main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
clang-format: build-and-push-image:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps: steps:
- uses: actions/checkout@v2 - name: Checkout repository
- name: clang-format uses: actions/checkout@v2
run: | - name: Extract Docker metadata
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include id: meta
build: uses: docker/metadata-action@v4
runs-on: ubuntu-latest with:
needs: clang-format images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
steps: tags: |
- uses: actions/checkout@master type=raw,value={{date 'YYYYMMDD'}}-{{sha}}
- name: Get release version type=raw,value={{date 'YYYYMMDD'}}
id: get_release_tag type=raw,value=latest
run: | - name: Log into registry ${{ env.REGISTRY }}
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV uses: docker/login-action@v2.1.0
echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV with:
echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV registry: ${{ env.REGISTRY }}
- name: Publish to Registry username: ${{ github.actor }}
uses: elgohr/Publish-Docker-Github-Action@master password: ${{ secrets.CI_PAT_WRITE_PACKAGE }}
with:
name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }} - name: Build and push Docker image
username: ${{ secrets.DOCKER_USERNAME }} uses: docker/build-push-action@v4
password: ${{ secrets.DOCKER_PASSWORD }} with:
snapshot: true context: .
cache: true tags: ${{ steps.meta.outputs.tags }}
tags: "latest, ${{ env.RELEASE_VERSION }}" labels: ${{ steps.meta.outputs.labels }}
push: true

View File

@ -1,4 +1,4 @@
FROM wiiuenv/devkitppc:20220806 FROM ghcr.io/wiiu-env/devkitppc:20220806
WORKDIR tmp_build WORKDIR tmp_build
COPY . . COPY . .

View File

@ -1,3 +1,3 @@
FROM wiiuenv/devkitppc:20220806 FROM ghcr.io/wiiu-env/devkitppc:20220806
WORKDIR project WORKDIR project

View File

@ -18,12 +18,12 @@ After that you can simply include `<sdutils/sdutils.h>` to get access to the sdu
A prebuilt version of this lib can found on dockerhub. To use it for your projects, add this to your Dockerfile. A prebuilt version of this lib can found on dockerhub. To use it for your projects, add this to your Dockerfile.
``` ```
[...] [...]
COPY --from=wiiuenv/libsdutils:[tag] /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libsdutils:[tag] /artifacts $DEVKITPRO
[...] [...]
``` ```
Replace [tag] with a tag you want to use, a list of tags can be found [here](https://hub.docker.com/r/wiiuenv/libsdutils/tags). Replace [tag] with a tag you want to use, a list of tags can be found [here](https://github.com/orgs/wiiu-env/packages/container/libsdutils/versions).
It's highly recommended to pin the version to the **latest date** instead of using `latest`. It's highly recommended to pin the version to the **latest date** instead of using `latest`.
## Format the code via docker ## Format the code via docker
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include -i` `docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include -i`