diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index f8856c69d244f92a0a65498fdee7425a111ce824..aa3e3e6582a6152786204db56903fc0eea34cd24 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -22,6 +22,6 @@ jobs: with: context: . push: false - tags: shieldsio/shields:pr-validation + tags: ghcr.io/badges/shields:pr-validation build-args: | version=${{ env.SHORT_SHA }} diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ef654a349108d9aa35d581a496ba40d84ad14cf9..50fc120ba9fc915b1a27d0c90553489ebf468a59 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -6,6 +6,7 @@ on: permissions: contents: write + packages: write jobs: create-release: @@ -52,3 +53,18 @@ jobs: tags: shieldsio/shields:server-${{ steps.date.outputs.date }} build-args: | version=server-${{ steps.date.outputs.date }} + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push snapshot release to GHCR + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ghcr.io/badges/shields:server-${{ steps.date.outputs.date }} + build-args: | + version=server-${{ steps.date.outputs.date }} diff --git a/.github/workflows/publish-docker-next.yml b/.github/workflows/publish-docker-next.yml index 1e0c70db6c77a81e442e87474f8c2ab18243e2f3..ccbc9c71ba84133ef89c2bbb7b7ebbaaa82154ba 100644 --- a/.github/workflows/publish-docker-next.yml +++ b/.github/workflows/publish-docker-next.yml @@ -4,6 +4,9 @@ on: branches: - master +permissions: + packages: write + jobs: publish-docker-next: runs-on: ubuntu-latest @@ -25,7 +28,7 @@ jobs: - name: Set Git Short SHA run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV - - name: Build and push + - name: Build and push to DockerHub uses: docker/build-push-action@v4 with: context: . @@ -33,3 +36,18 @@ jobs: tags: shieldsio/shields:next build-args: | version=${{ env.SHORT_SHA }} + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push to GHCR + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ghcr.io/badges/shields:next + build-args: | + version=${{ env.SHORT_SHA }}