-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
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,44 @@ | ||
name: Publish AlmaLinux | ||
description: Reusable action to publish the AlmaLinux Docker image | ||
|
||
inputs: | ||
registry-username: | ||
description: registry username | ||
required: true | ||
registry-password: | ||
description: registry password | ||
required: true | ||
docker-tags: | ||
description: Docker image tags | ||
required: true | ||
docker-labels: | ||
description: Docker image labels | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# needed to build multi-platform images | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to CERN registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: registry.cern.ch | ||
username: ${{ inputs.registry-username }} | ||
password: ${{ inputs.registry-password }} | ||
|
||
- run: echo "Publishing Docker images with tags '${{ inputs.docker-tags }}' and labels '${{ inputs.docker-labels }}'" | ||
shell: bash | ||
|
||
- name: Publish AlmaLinux | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./almalinux/ | ||
file: ./almalinux/Dockerfile | ||
# support images for Intel and Apple Silicon processors | ||
platforms: linux/amd64, linux/arm64 | ||
push: true | ||
tags: ${{ inputs.docker-tags }} | ||
labels: ${{ inputs.docker-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Publish AlmaLinux | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
# schedule: | ||
# - cron: "0 1 * * 2" # at 01:00 on Tuesday | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: 'Reason' | ||
required: false | ||
default: 'Manual trigger' | ||
|
||
jobs: | ||
|
||
almalinux: | ||
name: Publish AlmaLinux | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# https://github.com/docker/metadata-action | ||
# Tags: | ||
# type=semver,pattern=...: on tag pushed, with a valid `semver`, the new image | ||
# will have tags `x`, `x.y`, `x.y.z`. Pre-release GIT tag will tag image | ||
# with only pre-release tag, e.g. `x.y.z-beta.67`, and not the others | ||
# Flavor: | ||
# `latest` will tag the image with `latest` | ||
- name: Set tags for Docker images | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: registry.cern.ch/cernopendata/cernopendata-portal | ||
tags: | | ||
type=semver,pattern={{major}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
type=semver,pattern={{version}} | ||
type=schedule,pattern={{date 'YYYYMMDD'}} | ||
flavor: | | ||
latest=true | ||
- name: Publish AlmaLinux | ||
uses: ./.github/actions/publish-almalinux | ||
with: | ||
registry-username: ${{ secrets.CERN_REGISTRY_USERNAME }} | ||
registry-password: ${{ secrets.CERN_REGISTRY_PASSWORD }} | ||
docker-tags: ${{ steps.meta.outputs.tags }} | ||
docker-labels: ${{ steps.meta.outputs.labels }} |