push images to both GHCR and DockerHub (#9008)
This commit is contained in:
2
.github/workflows/build-docker-image.yml
vendored
2
.github/workflows/build-docker-image.yml
vendored
@@ -22,6 +22,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
tags: shieldsio/shields:pr-validation
|
tags: ghcr.io/badges/shields:pr-validation
|
||||||
build-args: |
|
build-args: |
|
||||||
version=${{ env.SHORT_SHA }}
|
version=${{ env.SHORT_SHA }}
|
||||||
|
|||||||
16
.github/workflows/create-release.yml
vendored
16
.github/workflows/create-release.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
@@ -52,3 +53,18 @@ jobs:
|
|||||||
tags: shieldsio/shields:server-${{ steps.date.outputs.date }}
|
tags: shieldsio/shields:server-${{ steps.date.outputs.date }}
|
||||||
build-args: |
|
build-args: |
|
||||||
version=server-${{ steps.date.outputs.date }}
|
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 }}
|
||||||
|
|||||||
20
.github/workflows/publish-docker-next.yml
vendored
20
.github/workflows/publish-docker-next.yml
vendored
@@ -4,6 +4,9 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-docker-next:
|
publish-docker-next:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -25,7 +28,7 @@ jobs:
|
|||||||
- name: Set Git Short SHA
|
- name: Set Git Short SHA
|
||||||
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
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
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -33,3 +36,18 @@ jobs:
|
|||||||
tags: shieldsio/shields:next
|
tags: shieldsio/shields:next
|
||||||
build-args: |
|
build-args: |
|
||||||
version=${{ env.SHORT_SHA }}
|
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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user