Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Moving to ghcr.io
Browse files Browse the repository at this point in the history
Moving CI to publish images in ghcr.io. This is an attempt to make us
able to publish images for PRs as well.
  • Loading branch information
ricardomaraschini committed Aug 17, 2021
1 parent b8d82f5 commit 10a4cd8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
- name: registry login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ghcr.io
username: ricardomaraschini
password: ${{ secrets.GITHUB_TOKEN }}

- name: build image and push
uses: docker/build-push-action@v2
with:
push: true
context: ./
file: ./Containerfile
tags: quay.io/tagger/operator:latest
tags: ghcr.io/ricardomaraschini/tagger:latest

release:
name: tagger development release
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,42 @@ jobs:
- name: build all
run: make build

image:
name: image
release:
name: release
needs:
- build
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v2

- name: build image
id: push
- name: get pr number
id: get_pr_number
run: echo ::set-output name=prnr::$(echo $GITHUB_REF | cut -d / -f 3)

- name: login to the registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push image
uses: docker/build-push-action@v2
with:
context: ./
file: ./Containerfile
tags: quay.io/tagger/operator:devel
push: true
tags: ghcr.io/${{ github.actor }}/tagger:pr-${{ steps.get_pr_number.outputs.prnr }}

- name: setting image repository in chart
run: sed -i 's/ricardomaraschini/${{ github.actor }}/g' chart/values.yaml

- name: setting image tag in chart
run: sed -i 's/latest/pr-${{ steps.get_pr_number.outputs.prnr }}/g' chart/values.yaml

- name: create helm artifact
uses: actions/upload-artifact@v2
with:
name: helm-chart
path: chart
8 changes: 4 additions & 4 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- name: registry login
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ghcr.io
username: ricardomaraschini
password: ${{ secrets.GITHUB_TOKEN }}

- name: extract current tag
id: get_tag
Expand All @@ -33,7 +33,7 @@ jobs:
version=${{ steps.get_tag.outputs.tag }}
context: ./
file: ./Containerfile
tags: quay.io/tagger/operator:${{ steps.get_tag.outputs.tag }}
tags: ghcr.io/ricardomaraschini/tagger:${{ steps.get_tag.outputs.tag }}

release:
name: tagger stable release
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# number of running tagger pods.
replicas: 1
# the image to be used when deploying tagger.
image: "quay.io/tagger/operator:latest"
image: "ghcr.io/ricardomaraschini/tagger:latest"
# key is the tls key to be used by tagger when communicating with kubernetes api.
# if not provided a self signed one will be generated during install and upgrade.
# this key must contain as alternative name 'mutating-webhooks.<namespace>.svc'.
Expand Down

0 comments on commit 10a4cd8

Please sign in to comment.