Skip to content

Commit

Permalink
puch images to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
bakito committed Nov 5, 2021
1 parent df77261 commit acd2dc3
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 10 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: quay
name: Build images

on:
push:
Expand All @@ -15,6 +15,12 @@ jobs:
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay
uses: docker/login-action@v1
with:
Expand All @@ -27,7 +33,7 @@ jobs:
if: ${{ github.event.release.tag_name != '' }}
with:
push: true
tags: quay.io/bakito/k8s-event-logger:latest,quay.io/bakito/k8s-event-logger:${{ github.event.release.tag_name }}
tags: ghcr.io/bakito/k8s-event-logger:latest,ghcr.io/bakito/k8s-event-logger:${{ github.event.release.tag_name }},quay.io/bakito/k8s-event-logger:latest,quay.io/bakito/k8s-event-logger:${{ github.event.release.tag_name }}
platforms: linux/amd64
build-args: VERSION=${{ github.event.release.tag_name }}

Expand All @@ -37,8 +43,17 @@ jobs:
if: ${{ github.event.release.tag_name == '' }}
with:
push: true
tags: quay.io/bakito/k8s-event-logger:master
tags: ghcr.io/bakito/k8s-event-logger:master,quay.io/bakito/k8s-event-logger:master
platforms: linux/amd64
build-args: VERSION=master
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

- name: Prune ghcr images
uses: vlaurin/action-ghcr-prune@main
with:
token: ${{ secrets.PRUNE_IMAGE_TOKEN }}
container: sealed-secrets-web
dry-run: false # Dry-run first, then change to `false`
older-than: 7 # days
untagged: true
45 changes: 45 additions & 0 deletions .github/workflows/upload-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Upload Helm Chart

on:
release:
types:
- published

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1

- name: Build chart
run: |
VERSION=$(echo "${{github.event.release.tag_name }}" | sed 's/v//g')
helm package ./helm/ --version $VERSION --app-version v$VERSION -d dist
- name: Install chart-releaser
uses: engineerd/[email protected]
with:
name: cr
url: https://github.com/helm/chart-releaser/releases/download/v1.2.1/chart-releaser_1.2.1_linux_amd64.tar.gz
pathInArchive: cr

- name: Upload Chart
run: cr upload
env:
CR_OWNER: "${{github.repository_owner}}"
CR_TOKEN: "${{secrets.CR_TOKEN}}"
CR_GIT_REPO: "helm-charts"
CR_PACKAGE_PATH: dist
6 changes: 0 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
before:
hooks:
- rm -f k8s-event-logger-operator-*.tgz && helm package ./helm/ --version {{ .Version }} --app-version v{{ .Version }}
builds:
- skip: true
main: ./main.go
Expand All @@ -10,9 +7,6 @@ checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
release:
extra_files:
- glob: ./k8s-event-logger-operator-*.tgz
changelog:
sort: asc
filters:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ docker-push:

.PHONY: release
release: goreleaser
@version=$$(semver); \
git tag -s $$version -m"Release $$version"
$(GORELEASER) --rm-dist

.PHONY: test-release
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Declare variables to be passed into your templates.

image:
repository: quay.io/bakito/k8s-event-logger
repository: ghcr.io/bakito/k8s-event-logger
pullPolicy: Always

eventLogger:
Expand Down

0 comments on commit acd2dc3

Please sign in to comment.