Skip to content

Commit

Permalink
.github: Move shell-ui image push to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyAndrieux committed Feb 28, 2024
1 parent 99e4593 commit dccdf3d
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@ on:
required: true
ARTIFACTS_PASSWORD:
required: true
HARBOR_PROD_PROJECT:
required: true
HARBOR_DEV_PROJECT:
required: true

# Push on development branch = PR merge
push:
branches:
- "development/**"

env:
REGISTRY_HOST: registry.scality.com
REGISTRY_HOST: ghcr.io
REGISTRY_PROJECT: "${{ github.repository }}"
IS_STABLE: "false"
IS_LATEST: "false"

Expand All @@ -42,14 +39,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# "Compute" the harbor project to use
- name: Set registry project to Prod
if: inputs.is_production
run: echo "REGISTRY_PROJECT=${{ secrets.HARBOR_PROD_PROJECT }}" >> $GITHUB_ENV
- name: Set registry project to Dev
if: "! inputs.is_production"
run: echo "REGISTRY_PROJECT=${{ secrets.HARBOR_DEV_PROJECT }}" >> $GITHUB_ENV

# Retrieve Shell UI image from the build, load it and compute version
- name: Retrieve artifacts url
if: inputs.artifacts-url == ''
Expand Down Expand Up @@ -107,14 +96,11 @@ jobs:
fi
# Tag shell-ui image before upload to registry
# (depending whether or not it's for production)
- name: Tag shell-ui image with current version
run: >
docker tag "shell-ui:v${{ env.SHELL_UI_VERSION }}"
"${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui:v${{ env.SHELL_UI_VERSION }}"
- name: Tag shell-ui image with commit short revision
# Only tag with commit short version when pushing on dev
if: "! inputs.is_production"
run: >
docker tag "shell-ui:v${{ env.SHELL_UI_VERSION }}"
"${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui:v${{ env.SHELL_UI_VERSION }}-${{ env.SHELL_UI_REF }}"
Expand All @@ -131,9 +117,11 @@ jobs:
# Push image to the registry
- name: Login to the registry
run: >
docker login "${{ env.REGISTRY_HOST }}"
--username "${{ secrets.REGISTRY_LOGIN }}" --password "${{ secrets.REGISTRY_PASSWORD }}"
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push shell-ui images to the registry
run: >
docker push --all-tags
Expand Down

0 comments on commit dccdf3d

Please sign in to comment.