Skip to content

Commit

Permalink
Merge pull request #32 from mallardduck/ghcr-only-devs
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck authored Jan 7, 2025
2 parents dcd9920 + 6f1cb38 commit 9f3ddf3
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/head-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
contents: write # Upload artefacts to release.

env:
PUBLIC_REGISTRY: docker.io
PUBLIC_REGISTRY: ghcr.io

jobs:
prebuild-env:
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:

public-registry: ${{ env.PUBLIC_REGISTRY }}
public-repo: ${{ vars.REPO || github.repository_owner }}
public-username: ${{ env.DOCKER_USERNAME || vars.DOCKER_USERNAME || github.repository_owner }}
public-password: ${{ env.DOCKER_PASSWORD || secrets.DOCKER_PASSWORD }}
public-username: ${{ github.actor }}
public-password: ${{ secrets.GITHUB_TOKEN }}

push-to-prime: false

Expand All @@ -81,23 +81,3 @@ jobs:
mkdir -p oras-install/
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
oras-install/oras copy ${{ env.FULL_IMAGE_URL }}:${{ env.STATIC_TAG }} ${{ env.FULL_IMAGE_URL }}:${{ env.LATEST_TAG }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Re-tag the image tags to ghcr.io/${{ github.repository_owner }}
env:
FULL_IMAGE_URL: ${{ env.PUBLIC_REGISTRY }}/${{ vars.REPO || github.repository_owner }}/${{ vars.IMAGE_NAME || 'kuberlr-kubectl' }}
STATIC_TAG: ${{ needs.prebuild-env.outputs.branch_static_tag }}
LATEST_TAG: ${{ needs.prebuild-env.outputs.branch_tag }}
FULL_IMAGE_GHCR_URL: ghcr.io/${{ github.repository_owner }}/${{ vars.IMAGE_NAME || 'kuberlr-kubectl' }}
run: |
VERSION="1.2.0"
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
mkdir -p oras-install/
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
oras-install/oras copy ${{ env.FULL_IMAGE_URL }}:${{ env.STATIC_TAG }} ${{ env.FULL_IMAGE_GHCR_URL }}:${{ env.STATIC_TAG }},${{ env.LATEST_TAG }}

0 comments on commit 9f3ddf3

Please sign in to comment.