Skip to content

Commit

Permalink
Merge pull request #98 from uyjulian/ghcr_upload
Browse files Browse the repository at this point in the history
Upload containers to Github Container Registry
  • Loading branch information
fjtrujy authored Nov 9, 2022
2 parents d472256 + 1dcb8fa commit 56d5b98
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,32 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: docker/build-push-action@v2
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set docker tag list to include DockerHub if credentials available
if: env.DOCKER_USERNAME != null
run: |
echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }},${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
- name: Set docker tag list to not include DockerHub if credentials not available
if: env.DOCKER_USERNAME == null
run: |
echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
- name: Build and Push to container registry
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ github.repository }}:${{ env.DOCKER_TAG }}
tags: ${{ env.DOCKER_TAG_LIST }}
build-args: |
BASE_DOCKER_DVP_IMAGE=${{ github.repository_owner }}/ps2toolchain-dvp:${{ env.DOCKER_TAG }}
BASE_DOCKER_IOP_IMAGE=${{ github.repository_owner }}/ps2toolchain-iop:${{ env.DOCKER_TAG }}
BASE_DOCKER_EE_IMAGE=${{ github.repository_owner }}/ps2toolchain-ee:${{ env.DOCKER_TAG }}
BASE_DOCKER_DVP_IMAGE=ghcr.io/${{ github.repository_owner }}/ps2toolchain-dvp:${{ env.DOCKER_TAG }}
BASE_DOCKER_IOP_IMAGE=ghcr.io/${{ github.repository_owner }}/ps2toolchain-iop:${{ env.DOCKER_TAG }}
BASE_DOCKER_EE_IMAGE=ghcr.io/${{ github.repository_owner }}/ps2toolchain-ee:${{ env.DOCKER_TAG }}
- name: Send Compile action
run: |
Expand Down

0 comments on commit 56d5b98

Please sign in to comment.