Skip to content

Commit 3caf3a2

Browse files
authored
Push images to ghcr.io (#344)
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
1 parent 1eabd16 commit 3caf3a2

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

.github/workflows/chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.7
25+
python-version: 3.8
2626
- name: Set up chart-testing
2727
uses: helm/[email protected]
2828
- name: Run chart-testing (list-changed)

.github/workflows/release.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ permissions: read-all
1010
jobs:
1111
build-and-publish-images:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write
1315
steps:
1416
- name: Set up QEMU
1517
uses: docker/setup-qemu-action@v3
1618
- name: Set up Docker Buildx
1719
uses: docker/setup-buildx-action@v3
18-
- name: Login to AWS Public ECR
20+
- name: Login to GitHub Container Registry
1921
uses: docker/login-action@v3
2022
with:
21-
registry: public.ecr.aws
22-
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
23-
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
2426
- name: Extract tag name
2527
id: extract_tag_name
2628
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
@@ -29,15 +31,23 @@ jobs:
2931
with:
3032
platforms: linux/amd64,linux/arm64
3133
file: database/migrations/Dockerfile
32-
tags: public.ecr.aws/g6m3a0y9/clowarden-dbmigrator:${{steps.extract_tag_name.outputs.tag}},public.ecr.aws/g6m3a0y9/clowarden-dbmigrator:latest
34+
tags: ghcr.io/${{ github.repository }}/dbmigrator:${{steps.extract_tag_name.outputs.tag}},ghcr.io/${{ github.repository }}/dbmigrator:latest
3335
push: true
36+
labels: |
37+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
38+
org.opencontainers.image.description=CLOWarden database migrator
39+
org.opencontainers.image.licenses=Apache-2.0
3440
- name: Build and push clowarden-server image
3541
uses: docker/build-push-action@v6
3642
with:
3743
platforms: linux/amd64,linux/arm64
3844
file: clowarden-server/Dockerfile
39-
tags: public.ecr.aws/g6m3a0y9/clowarden-server:${{steps.extract_tag_name.outputs.tag}},public.ecr.aws/g6m3a0y9/clowarden-server:latest
45+
tags: ghcr.io/${{ github.repository }}/server:${{steps.extract_tag_name.outputs.tag}},ghcr.io/${{ github.repository }}/server:latest
4046
push: true
47+
labels: |
48+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
49+
org.opencontainers.image.description=CLOWarden server
50+
org.opencontainers.image.licenses=Apache-2.0
4151
4252
package-and-publish-helm-chart:
4353
needs:

charts/clowarden/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: clowarden
33
description: CLOWarden is a tool that manages access to resources across multiple services
44
type: application
5-
version: 0.2.0
5+
version: 0.2.1-0
66
appVersion: 0.2.0
77
kubeVersion: ">= 1.19.0-0"
88
home: https://clowarden.io
@@ -42,9 +42,9 @@ annotations:
4242
description: Issue processing email invitations
4343
artifacthub.io/images: |
4444
- name: dbmigrator
45-
image: public.ecr.aws/g6m3a0y9/clowarden-dbmigrator:v0.2.0
45+
image: ghcr.io/cncf/clowarden/dbmigrator:v0.2.0
4646
- name: server
47-
image: public.ecr.aws/g6m3a0y9/clowarden-server:v0.2.0
47+
image: ghcr.io/cncf/clowarden/server:v0.2.0
4848
artifacthub.io/links: |
4949
- name: source
5050
url: https://github.com/cncf/clowarden

charts/clowarden/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dbmigrator:
3636
job:
3737
image:
3838
# Database migrator image repository (without the tag)
39-
repository: public.ecr.aws/g6m3a0y9/clowarden-dbmigrator
39+
repository: ghcr.io/cncf/clowarden/dbmigrator
4040

4141
# CLOWarden server configuration
4242
server:
@@ -83,7 +83,7 @@ server:
8383
deploy:
8484
replicaCount: 1 # Do not increase
8585
image:
86-
repository: public.ecr.aws/g6m3a0y9/clowarden-server
86+
repository: ghcr.io/cncf/clowarden/server
8787
resources: {}
8888

8989
# Services CLOWarden will manage

clowarden-core/src/services/github/state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ impl State {
404404
// Teams
405405
let mut teams_old = HashSet::new();
406406
if let Some(teams) = &repos_old[repo_name].teams {
407-
teams_old = teams.iter().map(|(name, _)| name).collect();
407+
teams_old = teams.keys().collect();
408408
}
409409
let mut teams_new = HashSet::new();
410410
if let Some(teams) = &repos_new[repo_name].teams {
411-
teams_new = teams.iter().map(|(name, _)| name).collect();
411+
teams_new = teams.keys().collect();
412412
}
413413
for team_name in teams_old.difference(&teams_new) {
414414
changes.push(RepositoryChange::TeamRemoved(
@@ -442,11 +442,11 @@ impl State {
442442
// Collaborators
443443
let mut collaborators_old = HashSet::new();
444444
if let Some(collaborators) = &repos_old[repo_name].collaborators {
445-
collaborators_old = collaborators.iter().map(|(name, _)| name).collect();
445+
collaborators_old = collaborators.keys().collect();
446446
}
447447
let mut collaborators_new = HashSet::new();
448448
if let Some(collaborators) = &repos_new[repo_name].collaborators {
449-
collaborators_new = collaborators.iter().map(|(name, _)| name).collect();
449+
collaborators_new = collaborators.keys().collect();
450450
}
451451
for user_name in collaborators_old.difference(&collaborators_new) {
452452
changes.push(RepositoryChange::CollaboratorRemoved(

0 commit comments

Comments
 (0)