Skip to content

Commit

Permalink
Migrate container images to ghcr.io (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
andmat900 authored Jan 29, 2025
1 parent 78e7384 commit 4820137
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- closed
workflow_dispatch:

permissions:
contents: write
packages: write

jobs:
build:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true }}
Expand All @@ -16,13 +20,17 @@ jobs:
- name: Build app image
run: docker build . --tag image

- name: Log into registry
run: echo "${{ secrets.REGISTRYPASSWORD }}" | docker login registry.nordix.org -u ${{ secrets.REGISTRYUSERNAME }} --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push app image
id: image
run: |
IMAGE_ID=registry.nordix.org/eiffel/etos-suite-starter
IMAGE_ID=ghcr.io/eiffel-community/etos-suite-starter
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
Expand All @@ -40,7 +48,7 @@ jobs:
with:
valueFile: 'manifests/base/deployment.yaml'
propertyPath: 'spec.template.spec.containers[0].image'
value: registry.nordix.org/eiffel/etos-suite-starter:${{ steps.image.outputs.version }}
value: ghcr.io/eiffel-community/etos-suite-starter:${{ steps.image.outputs.version }}
branch: main
commitChange: true
message: Updating manifest image to version ${{ steps.image.outputs.version }}
2 changes: 1 addition & 1 deletion manifests/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
serviceAccountName: etos-suite-starter
containers:
- name: etos-suite-starter
image: registry.nordix.org/eiffel/etos-suite-starter:28ac79b9
image: ghcr.io/eiffel-community/etos-suite-starter:28ac79b9
imagePullPolicy: IfNotPresent
volumeMounts:
- name: suite-runner-template
Expand Down

0 comments on commit 4820137

Please sign in to comment.