diff --git a/.github/workflows/head-build.yml b/.github/workflows/head-build.yml index b4b3e04..56adcb4 100644 --- a/.github/workflows/head-build.yml +++ b/.github/workflows/head-build.yml @@ -14,7 +14,7 @@ permissions: contents: write # Upload artefacts to release. env: - PUBLIC_REGISTRY: docker.io + PUBLIC_REGISTRY: ghcr.io jobs: prebuild-env: @@ -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 @@ -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 }}