Skip to content

Commit

Permalink
Merge pull request #8628 from weseek/support/omit-publishing-to-ghcr-…
Browse files Browse the repository at this point in the history
…configurations

support: Omit configurations for publishing to GitHub Container Registry(ghcr.io)
  • Loading branch information
yuki-takei committed Mar 28, 2024
2 parents 27e3055 + 4890a97 commit da0c06f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 65 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/release-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:

outputs:
TAGS: ${{ steps.meta.outputs.tags }}
TAGS_GHCR: ${{ steps.meta-ghcr.outputs.tags }}

steps:
- uses: actions/checkout@v3
Expand All @@ -37,16 +36,6 @@ jobs:
type=raw,value=${{ steps.package-json.outputs.packageVersion }}
type=raw,value=${{ steps.package-json.outputs.packageVersion }}.{{sha}}
- name: Docker meta for ghcr.io
uses: docker/metadata-action@v4
id: meta-ghcr
with:
images: ghcr.io/weseek/growi
sep-tags: ','
tags: |
type=raw,value=${{ steps.package-json.outputs.packageVersion }}
type=raw,value=${{ steps.package-json.outputs.packageVersion }}.{{sha}}
build-image-rc:
uses: weseek/growi/.github/workflows/reusable-app-build-image.yml@master
Expand All @@ -69,15 +58,3 @@ jobs:
secrets:
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

publish-image-rc-ghcr:
needs: [determine-tags, build-image-rc]

uses: weseek/growi/.github/workflows/reusable-app-create-manifests.yml@master
with:
tags: ${{ needs.determine-tags.outputs.TAGS_GHCR }}
registry: ghcr.io
image-name: weseek/growi
tag-temporary: latest-rc
secrets:
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}

9 changes: 1 addition & 8 deletions .github/workflows/release-slackbot-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: weseek/growi-slackbot-proxy,ghcr.io/weseek/growi-slackbot-proxy,asia.gcr.io/${{ secrets.GCP_PRJ_ID_SLACKBOT_PROXY }}/growi-slackbot-proxy
images: weseek/growi-slackbot-proxy,asia.gcr.io/${{ secrets.GCP_PRJ_ID_SLACKBOT_PROXY }}/growi-slackbot-proxy
tags: |
type=raw,value=latest
type=raw,value=${{ steps.package-json.outputs.packageVersion }}
Expand All @@ -35,13 +35,6 @@ jobs:
run: |
echo ${{ secrets. DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: wsmoogle
password: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}

- name: Authenticate to Google Cloud for GROWI.cloud
uses: google-github-actions/auth@v1
with:
Expand Down
29 changes: 2 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:

outputs:
TAGS: ${{ steps.meta.outputs.tags }}
TAGS_GHCR: ${{ steps.meta-ghcr.outputs.tags }}

steps:
- uses: actions/checkout@v3
Expand All @@ -103,18 +102,6 @@ jobs:
type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}
type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}.{{patch}}
- name: Docker meta for ghcr.io
uses: docker/metadata-action@v4
id: meta-ghcr
with:
images: ghcr.io/weseek/growi
sep-tags: ','
tags: |
type=raw,value=latest
type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}
type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}
type=semver,value=${{ needs.create-github-release.outputs.RELEASED_VERSION }},pattern={{major}}.{{minor}}.{{patch}}
build-image:
needs: create-github-release
Expand All @@ -140,21 +127,9 @@ jobs:
secrets:
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}

publish-image-ghcr:
needs: [determine-tags, build-image]

uses: weseek/growi/.github/workflows/reusable-app-create-manifests.yml@master
with:
tags: ${{ needs.determine-tags.outputs.TAGS_GHCR }}
registry: ghcr.io
image-name: weseek/growi
tag-temporary: latest
secrets:
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}


post-publish:
needs: [create-github-release, publish-image, publish-image-ghcr]
needs: [create-github-release, publish-image]
runs-on: ubuntu-latest

steps:
Expand All @@ -179,7 +154,7 @@ jobs:


create-pr-for-next-rc:
needs: [create-github-release, publish-image, publish-image-ghcr]
needs: [create-github-release, publish-image]
runs-on: ubuntu-latest

steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/reusable-app-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ jobs:
CODEBUILD__environmentTypeOverride: ${{ (matrix.platform == 'amd64' && 'LINUX_CONTAINER') || 'ARM_CONTAINER' }}
CODEBUILD__environmentVariablesOverride: '[
{ "name": "IMAGE_TAG", "type": "PLAINTEXT", "value": "docker.io/${{ inputs.image-name }}:${{ inputs.tag-temporary }}-${{ matrix.platform }}" },
{ "name": "IMAGE_TAG_GHCR", "type": "PLAINTEXT", "value": "ghcr.io/${{ inputs.image-name }}:${{ inputs.tag-temporary }}-${{ matrix.platform }}" }
]'
7 changes: 1 addition & 6 deletions apps/app/docker/codebuild/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ env:
variables:
DOCKER_BUILDKIT: 1
IMAGE_TAG: ''
IMAGE_TAG_GHCR: ''
secrets-manager:
DOCKER_REGISTRY_PASSWORD: growi/official-image-builder:DOCKER_REGISTRY_PASSWORD
DOCKER_REGISTRY_ON_GITHUB_PAT: growi/official-image-builder:DOCKER_REGISTRY_ON_GITHUB_PAT

phases:
pre_build:
Expand All @@ -19,17 +17,14 @@ phases:
- git-lfs pull
# login to docker.io
- echo ${DOCKER_REGISTRY_PASSWORD} | docker login --username wsmoogle --password-stdin
# login to ghcr.io
- echo ${DOCKER_REGISTRY_ON_GITHUB_PAT} | docker login ghcr.io --username wsmoogle --password-stdin
build:
commands:
- docker build -t ${IMAGE_TAG} -f ./apps/app/docker/Dockerfile .
- docker tag ${IMAGE_TAG} ${IMAGE_TAG_GHCR}
- docker tag ${IMAGE_TAG}

post_build:
commands:
- docker push $IMAGE_TAG
- docker push $IMAGE_TAG_GHCR

cache:
paths:
Expand Down

0 comments on commit da0c06f

Please sign in to comment.