add publish to GitHub Container Registry

This commit is contained in:
Oskar 2022-02-26 19:01:26 +01:00 committed by GitHub
parent a746a54e53
commit f19d57b956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 19 deletions

View File

@ -11,7 +11,7 @@ on:
pull_request: pull_request:
jobs: jobs:
archlinux: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -25,29 +25,24 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} 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 uses: docker/build-push-action@v2
with: with:
context: archlinux context: archlinux
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: medzik/android-sdk:archlinux tags: |
medzik/android-sdk:archlinux
ghcr.io/medzikuser/android-sdk:archlinux
ubuntu: - name: Build and push Docker image (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
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ubuntu context: ubuntu
@ -55,3 +50,5 @@ jobs:
tags: | tags: |
medzik/android-sdk:ubuntu medzik/android-sdk:ubuntu
medzik/android-sdk:latest medzik/android-sdk:latest
ghcr.io/medzikuser/android-sdk:ubuntu
ghcr.io/medzikuser/android-sdk:latest