✏️ Switch form DockerHub to ghcr.io

This commit is contained in:
Sebastien Clement 2021-02-10 15:40:08 +01:00
parent eaf926f42e
commit 7e64da2d65

View File

@ -8,13 +8,13 @@ on:
env:
TARGET: nextcloud_backup
IMAGE: "{arch}-hassio-nextcloud-backup"
REPOSITORY: sebclemhassaddon
IMAGE: "hassio-nextcloud-backup"
REPOSITORY: ghcr.io/sebclem
jobs:
build-armhf:
build-dockers:
runs-on: ubuntu-latest
strategy:
fail-fast: true
@ -56,28 +56,27 @@ jobs:
echo "DESCRIPTION=$(jq --raw-output '.description // empty' "${{env.TARGET}}/config.json" | sed "s/'//g")" >> $GITHUB_ENV
echo "URL=$(jq --raw-output '.url // empty' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
echo "VERSION=$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
echo "IMAGE=$(echo "${{env.IMAGE}}" | sed -r "s/\{arch\}/${{matrix.arch}}/g")" >> $GITHUB_ENV
echo "BUILD_FROM=hassioaddons/base-${{matrix.arch}}:$(cat nextcloud_backup/.base_version)" >> $GITHUB_ENV
- name: Set Tags ${{matrix.arch}}
run: |
if [ "${{env.version_type}}" != "dev" ]; then
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}:latest, ${{env.REPOSITORY}}/${{env.IMAGE}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:latest, ${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
else
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}:dev, ${{env.REPOSITORY}}/${{env.IMAGE}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
echo "TAGS=${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:dev, ${{env.REPOSITORY}}/${{env.IMAGE}}/${{matrix.arch}}:$(jq --raw-output '.version' "${{env.TARGET}}/config.json")" >> $GITHUB_ENV
fi
- name: Debug Env
run: |
echo ${{env.IMAGE}}
echo ${{env.VERSION}}
echo ${{env.TAGS}}
- name: Login to DockerHub
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push ${{matrix.arch}}
uses: docker/build-push-action@v2