-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c59823
commit f0246a2
Showing
14 changed files
with
110 additions
and
290 deletions.
There are no files selected for viewing
55 changes: 30 additions & 25 deletions
55
...ester/.github/workflows/docker-images.yml → ...kflows/build-and-publish-docker-image.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,69 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- $default-branch | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
workflow_call: | ||
inputs: | ||
context-path: | ||
description: 'The context used to generate the Docker image' | ||
required: true | ||
type: string | ||
image-name: | ||
description: 'Name of the Docker image. It will appended to the repo name' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
docker_image: | ||
name: 'Build ${{ inputs.image-name }} Docker image' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}-${{ inputs.image-name }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to GHCR | ||
if: github.event_name != 'pull_request' | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Transform GitHub Actions metadata to Docker image tags | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
labels: | | ||
org.opencontainers.image.vendor=GeoCat B.V. | ||
org.opencontainers.image.vendor=GeoNetwork | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=ref,event=tag | ||
type=semver,pattern=v{{version}} | ||
type=semver,pattern=v{{major}}.{{minor}} | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | ||
type=raw,value={{branch}}-{{sha}},enable=${{ !startsWith(github.ref, 'refs/tags/') }} | ||
- name: Build image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./Dockerfile | ||
file: ./${{ inputs.context-path }}/Dockerfile | ||
build-args: | | ||
MODULE=${{ inputs.context-path }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/')}} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
|
||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Build docker images of all the services and publish them to ghcr.io in some cases | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_docker_images: | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
matrix: | ||
module: [csw-harvester, full-orchestrator, ingester, linkchecker] | ||
uses: ./.github/workflows/build-and-publish-docker-image.yml | ||
with: | ||
context-path: services/${{ matrix.module }} | ||
image-name: ${{ matrix.module }} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
services/csw-harvester/.github/workflows/docker-images.yml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
services/full-orchestrator/.github/workflows/docker-images.yml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.