diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index af6f91f..46c2bfd 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -72,6 +72,8 @@ jobs: runs-on: ubuntu-latest needs: prepare environment: ${{ needs.prepare.outputs.env_name }} + permissions: + packages: write steps: - name: Checkout uses: actions/checkout@v3 @@ -86,6 +88,13 @@ jobs: username: ${{ vars.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build & push container image id: build-container env: @@ -94,3 +103,12 @@ jobs: run: | docker build --build-arg="VERSION=$IMAGE_TAG" -t $REPOSITORY:$IMAGE_TAG . docker push $REPOSITORY:$IMAGE_TAG + + - name: Build & push container image, ghcr.io + id: build-container + env: + REPOSITORY: ghcr.io/${{ github.repository_owner }}/helm-charts-oci-proxy + IMAGE_TAG: ${{ needs.prepare.outputs.tag_name }} + run: | + docker build --build-arg="VERSION=$IMAGE_TAG" -t $REPOSITORY:$IMAGE_TAG . + docker push $REPOSITORY:$IMAGE_TAG diff --git a/.github/workflows/publish-chart.yml b/.github/workflows/publish-chart.yml index f1424e7..51050b2 100644 --- a/.github/workflows/publish-chart.yml +++ b/.github/workflows/publish-chart.yml @@ -15,6 +15,8 @@ on: jobs: publish-chart: runs-on: ubuntu-latest + permissions: + packages: write steps: - name: Checkout Code uses: actions/checkout@v3 @@ -33,6 +35,11 @@ jobs: - name: Login to Registry run: echo "${{ secrets.REGISTRY_PASSWORD }}" | helm registry login ${{ vars.REGISTRY_ADDR }} --username ${{ vars.REGISTRY_USERNAME }} --password-stdin + - name: Login to Registry, ghcr.io + run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.repository_owner }} --password-stdin + - name: Push Packaged Chart to Registry run: helm push ./tmp/* oci://${{ vars.REGISTRY_ADDR }}/library + - name: Push Packaged Chart to Registry, ghcr.io + run: helm push ./tmp/* oci://ghcr.io/${{ github.repository_owner }}/chart