Skip to content

Commit

Permalink
Clean up publish job
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jan 19, 2023
1 parent 6e1c4cc commit 7fa5972
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ on:
value: ${{ jobs.init.outputs.repo }}
db-image:
value: ${{ jobs.init.outputs.db-image }}
registry:
value: ${{ jobs.init.outputs.registry }}
registry-namespace:
value: ${{ jobs.init.outputs.registry-namespace }}

jobs:
init:
Expand All @@ -28,8 +24,6 @@ jobs:
base-image: ${{ steps.init.outputs.base-image }}
repo: ${{ steps.init.outputs.repo }}
db-image: ${{ steps.init.outputs.db-image }}
registry: ${{ steps.init.outputs.registry }}
registry-namespace: ${{ steps.init.outputs.registry-namespace }}
steps:
- name: Clone repository
uses: actions/checkout@v3
Expand All @@ -40,7 +34,5 @@ jobs:
BASE64_OS: ${{ secrets.BASE64_OS }}
BASE64_REPO: ${{ secrets.BASE64_REPO }}
BASE64_DATABASE: ${{ secrets.BASE64_DATABASE }}
REGISTRY: ${{ vars.REGISTRY }}
REGISTRY_NAMESPACE: ${{ vars.REGISTRY_NAMESPACE }}
run: |
tests/bin/init-workflow.sh
9 changes: 6 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- v1

env:
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || github.repository_owner }}

jobs:
init:
name: Initialization
Expand Down Expand Up @@ -33,7 +36,7 @@ jobs:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: vars.REGISTRY == 'ghcr.io'
Expand All @@ -55,5 +58,5 @@ jobs:
- name: Publish idm-console-framework-dist image
run: |
docker load --input idm-console-framework-dist.tar
docker tag idm-console-framework-dist ${{ needs.init.outputs.registry }}/${{ needs.init.outputs.registry-namespace }}/idm-console-framework-dist:1
docker push ${{ needs.init.outputs.registry }}/${{ needs.init.outputs.registry-namespace }}/idm-console-framework-dist:1
docker tag idm-console-framework-dist ${{ vars.REGISTRY }}/$NAMESPACE/idm-console-framework-dist:1
docker push ${{ vars.REGISTRY }}/$NAMESPACE/idm-console-framework-dist:1
21 changes: 1 addition & 20 deletions tests/bin/init-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ echo "base-image=$BASE_IMAGE" >> $GITHUB_OUTPUT
################################################################################
# COPR repository

if [ "$BASE64_REPO" == "" ]
if [ "$BASE64_REPO" != "" ]
then
REPO=""
else
REPO=$(echo "$BASE64_REPO" | base64 -d)
fi

Expand All @@ -38,20 +36,3 @@ fi

echo "DB_IMAGE: $DB_IMAGE"
echo "db-image=$DB_IMAGE" >> $GITHUB_OUTPUT

################################################################################
# Container registry

echo "REGISTRY: $REGISTRY"
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT

################################################################################
# Container registry namespace

if [ "$REGISTRY_NAMESPACE" == "" ]
then
REGISTRY_NAMESPACE=$GITHUB_REPOSITORY_OWNER
fi

echo "REGISTRY_NAMESPACE: $REGISTRY_NAMESPACE"
echo "registry-namespace=$REGISTRY_NAMESPACE" >> $GITHUB_OUTPUT

0 comments on commit 7fa5972

Please sign in to comment.