Skip to content

Commit

Permalink
Adding the creation of the image
Browse files Browse the repository at this point in the history
  • Loading branch information
psaiz committed Feb 15, 2024
1 parent 2cdd45b commit 3c62f11
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/actions/publish-almalinux/actions.yml
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 }}
53 changes: 53 additions & 0 deletions .github/workflows/publish_almalinux9.yml
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 }}

0 comments on commit 3c62f11

Please sign in to comment.