ci: support building images in forks (#1002)
This commit is contained in:
@@ -99,6 +99,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||||
|
|
||||||
- name: Authenticate to Docker Hub
|
- name: Authenticate to Docker Hub
|
||||||
|
if: ${{ vars.DOCKERHUB_REGISTRY != '' }}
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
@@ -111,27 +112,35 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ vars.DOCKERHUB_REGISTRY }}
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=nightly
|
||||||
|
type=raw,value=${{ env.nightly_tag }}
|
||||||
|
|
||||||
|
- name: Build and push Stable image
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
grimmory/grimmory:${{ env.nightly_tag }}
|
annotations: ${{ steps.meta.outputs.annotations }}
|
||||||
grimmory/grimmory:nightly
|
|
||||||
ghcr.io/grimmory-tools/grimmory:${{ env.nightly_tag }}
|
|
||||||
ghcr.io/grimmory-tools/grimmory:nightly
|
|
||||||
build-args: |
|
build-args: |
|
||||||
APP_VERSION=${{ env.nightly_tag }}
|
APP_VERSION=${{ env.nightly_tag }}
|
||||||
APP_REVISION=${{ env.commit_sha }}
|
APP_REVISION=${{ env.commit_sha }}
|
||||||
cache-from: |
|
cache-from: |
|
||||||
type=gha,scope=image-shared
|
type=gha,scope=image-shared
|
||||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
|
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
|
||||||
cache-to: |
|
cache-to: |
|
||||||
type=gha,scope=image-shared,mode=max
|
type=gha,scope=image-shared,mode=max
|
||||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max
|
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
|
||||||
|
|
||||||
export-openapi:
|
export-openapi:
|
||||||
name: Export Nightly OpenAPI Artifact
|
name: Export Nightly OpenAPI Artifact
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
||||||
|
|
||||||
- name: Authenticate to Docker Hub
|
- name: Authenticate to Docker Hub
|
||||||
|
if: ${{ vars.DOCKERHUB_REGISTRY != '' }}
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
@@ -42,6 +43,17 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ github.token }}
|
password: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ vars.DOCKERHUB_REGISTRY }}
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern=v{{version}},value=${{ github.event.release.tag_name }},match=^v(.+)$
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}},value=${{ github.event.release.tag_name }},match=^v(.+)$
|
||||||
|
|
||||||
- name: Build and push Stable image
|
- name: Build and push Stable image
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
||||||
with:
|
with:
|
||||||
@@ -49,20 +61,17 @@ jobs:
|
|||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
grimmory/grimmory:${{ github.event.release.tag_name }}
|
annotations: ${{ steps.meta.outputs.annotations }}
|
||||||
grimmory/grimmory:latest
|
|
||||||
ghcr.io/grimmory-tools/grimmory:${{ github.event.release.tag_name }}
|
|
||||||
ghcr.io/grimmory-tools/grimmory:latest
|
|
||||||
build-args: |
|
build-args: |
|
||||||
APP_VERSION=${{ github.event.release.tag_name }}
|
APP_VERSION=${{ github.event.release.tag_name }}
|
||||||
APP_REVISION=${{ github.sha }}
|
APP_REVISION=${{ github.sha }}
|
||||||
cache-from: |
|
cache-from: |
|
||||||
type=gha,scope=image-shared
|
type=gha,scope=image-shared
|
||||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache
|
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
|
||||||
cache-to: |
|
cache-to: |
|
||||||
type=gha,scope=image-shared,mode=max
|
type=gha,scope=image-shared,mode=max
|
||||||
type=registry,ref=ghcr.io/grimmory-tools/grimmory:buildcache,mode=max
|
type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
|
||||||
|
|
||||||
prepare-release-notification:
|
prepare-release-notification:
|
||||||
name: Prepare Stable Release Notification
|
name: Prepare Stable Release Notification
|
||||||
|
|||||||
Reference in New Issue
Block a user