Skip to content

change image name

change image name #1

name: Build keycloak-demo docker image
on:
push:
branches: [ main ]
tags:
- 'v*'
workflow_dispatch:
jobs:
push_to_registries:
name: Push Docker image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v6
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v6
with:
images: |
ghcr.io/nersc/keycloak-demo
tags: |
type=raw,value=latest
type=ref,event=branch
type=ref,event=tag
- name: Prepare build dir
run: |
build_dir="${{ github.workspace }}/docker-build"
mkdir -p "$build_dir"
cp "${{ github.workspace }}/keycloak-image/Dockerfile" "$build_dir/Dockerfile"
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: ${{ github.workspace }}/docker-build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}