Skip to content

Commit

Permalink
push image to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
defo89 committed Jan 9, 2025
1 parent edae012 commit fbcef63
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/container-registry-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################################################################
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
# Edit Makefile.maker.yaml instead. #
################################################################################

# Copyright 2024 SAP SE
# SPDX-License-Identifier: Apache-2.0

name: Container Registry GHCR
"on":
push:
branches:
- master
workflow_dispatch: {}
permissions:
contents: read
packages: write
jobs:
build-and-push-image:
name: Push container to ghcr.io
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
# https://github.com/docker/metadata-action#typeedge
type=edge
# https://github.com/docker/metadata-action#latest-tag
type=raw,value=latest,enable={{is_default_branch}}
# https://github.com/docker/metadata-action#typesemver
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
# https://github.com/docker/metadata-action#typesha
type=sha,format=long
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
8 changes: 8 additions & 0 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ githubWorkflow:
enabled: true
securityChecks:
enabled: true
pushContainerToGhcr:
enabled: true
platforms: "linux/amd64"
tagStrategy:
- edge
- latest
- semver
- sha

renovate:
enabled: true
Expand Down
1 change: 0 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ with pkgs;

mkShell {
nativeBuildInputs = [
addlicense
go-licence-detector
go_1_23
golangci-lint
Expand Down

0 comments on commit fbcef63

Please sign in to comment.