Skip to content

Commit 9f3ddf3

Browse files
authored
Merge pull request #32 from mallardduck/ghcr-only-devs
2 parents dcd9920 + 6f1cb38 commit 9f3ddf3

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

.github/workflows/head-build.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
contents: write # Upload artefacts to release.
1515

1616
env:
17-
PUBLIC_REGISTRY: docker.io
17+
PUBLIC_REGISTRY: ghcr.io
1818

1919
jobs:
2020
prebuild-env:
@@ -65,8 +65,8 @@ jobs:
6565

6666
public-registry: ${{ env.PUBLIC_REGISTRY }}
6767
public-repo: ${{ vars.REPO || github.repository_owner }}
68-
public-username: ${{ env.DOCKER_USERNAME || vars.DOCKER_USERNAME || github.repository_owner }}
69-
public-password: ${{ env.DOCKER_PASSWORD || secrets.DOCKER_PASSWORD }}
68+
public-username: ${{ github.actor }}
69+
public-password: ${{ secrets.GITHUB_TOKEN }}
7070

7171
push-to-prime: false
7272

@@ -81,23 +81,3 @@ jobs:
8181
mkdir -p oras-install/
8282
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
8383
oras-install/oras copy ${{ env.FULL_IMAGE_URL }}:${{ env.STATIC_TAG }} ${{ env.FULL_IMAGE_URL }}:${{ env.LATEST_TAG }}
84-
-
85-
name: Login to GitHub Container Registry
86-
uses: docker/login-action@v3
87-
with:
88-
registry: ghcr.io
89-
username: ${{ github.actor }}
90-
password: ${{ secrets.GITHUB_TOKEN }}
91-
92-
- name: Re-tag the image tags to ghcr.io/${{ github.repository_owner }}
93-
env:
94-
FULL_IMAGE_URL: ${{ env.PUBLIC_REGISTRY }}/${{ vars.REPO || github.repository_owner }}/${{ vars.IMAGE_NAME || 'kuberlr-kubectl' }}
95-
STATIC_TAG: ${{ needs.prebuild-env.outputs.branch_static_tag }}
96-
LATEST_TAG: ${{ needs.prebuild-env.outputs.branch_tag }}
97-
FULL_IMAGE_GHCR_URL: ghcr.io/${{ github.repository_owner }}/${{ vars.IMAGE_NAME || 'kuberlr-kubectl' }}
98-
run: |
99-
VERSION="1.2.0"
100-
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
101-
mkdir -p oras-install/
102-
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
103-
oras-install/oras copy ${{ env.FULL_IMAGE_URL }}:${{ env.STATIC_TAG }} ${{ env.FULL_IMAGE_GHCR_URL }}:${{ env.STATIC_TAG }},${{ env.LATEST_TAG }}

0 commit comments

Comments
 (0)