From f19d57b9569cea5eacc16f2356227783d29bf833 Mon Sep 17 00:00:00 2001 From: Oskar Date: Sat, 26 Feb 2022 19:01:26 +0100 Subject: [PATCH] add publish to GitHub Container Registry --- .github/workflows/docker-publish.yml | 35 +++++++++++++--------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7fc03ce..6b432b2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,7 +11,7 @@ on: pull_request: jobs: - archlinux: + build: runs-on: ubuntu-latest steps: @@ -25,29 +25,24 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Docker image + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image (archlinux) uses: docker/build-push-action@v2 with: context: archlinux push: ${{ github.event_name != 'pull_request' }} - tags: medzik/android-sdk:archlinux + tags: | + medzik/android-sdk:archlinux + ghcr.io/medzikuser/android-sdk:archlinux - ubuntu: - needs: archlinux - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image + - name: Build and push Docker image (ubuntu) uses: docker/build-push-action@v2 with: context: ubuntu @@ -55,3 +50,5 @@ jobs: tags: | medzik/android-sdk:ubuntu medzik/android-sdk:latest + ghcr.io/medzikuser/android-sdk:ubuntu + ghcr.io/medzikuser/android-sdk:latest