Skip to content

Commit

Permalink
[MOD] gh workflow to pass secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnuttinck committed Dec 6, 2023
1 parent b0d82f0 commit c92e4af
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/docker-hub-publish-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
- name: Build and publish base image to harbor
uses: IMIO/buildout.pm/actions/harbor@mod-gh-actions-PMIND-47
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
tags: |
imiobe/iadelib:base
"${{ secrets.HARBOR_URL }}/delib/iadelib:base"
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/docker-hub-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ jobs:
- name: Build latest
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
tags: |
imiobe/iadelib:latest
"${{ secrets.HARBOR_URL }}/delib/iadelib:latest"
dockerfile: ./docker/Dockerfile-latest
- name: Build and publish dev image
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
tags: imiobe/iadelib:dev
dockerfile: ./docker/Dockerfile-dev
profile: communes-dev
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
- name: Build and publish communes image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
tags: |
"imiobe/iadelib:${{ github.ref_name }}"
"imiobe/iadelib:communes-${{ github.ref_name }}"
Expand All @@ -23,6 +28,11 @@ jobs:
- name: Build and publish bep image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: bep
tags: |
"imiobe/iadelib:bep-${{ github.ref_name }}"
Expand All @@ -34,6 +44,11 @@ jobs:
- name: Build and publish charleroi image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: charleroi
tags: |
"imiobe/iadelib:charleroi-${{ github.ref_name }}"
Expand All @@ -45,6 +60,11 @@ jobs:
- name: Build and publish hainaut-prov image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: hainaut-prov
tags: |
"imiobe/iadelib:hainaut-prov-${{ github.ref_name }}"
Expand All @@ -56,6 +76,11 @@ jobs:
- name: Build and publish lalouviere image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: lalouviere
tags: |
"imiobe/iadelib:lalouviere-${{ github.ref_name }}"
Expand All @@ -67,6 +92,11 @@ jobs:
- name: Build and publish lalouviere-cpas image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: lalouviere-cpas
tags: |
"imiobe/iadelib:lalouviere-cpas-${{ github.ref_name }}"
Expand All @@ -78,6 +108,11 @@ jobs:
- name: Build and publish liege image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: liege
tags: |
"imiobe/iadelib:liege-${{ github.ref_name }}"
Expand All @@ -89,6 +124,11 @@ jobs:
- name: Build and publish mons image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: mons
tags: |
"imiobe/iadelib:mons-${{ github.ref_name }}"
Expand All @@ -100,6 +140,11 @@ jobs:
- name: Build and publish namur image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: namur
tags: |
"imiobe/iadelib:namur-${{ github.ref_name }}"
Expand All @@ -111,6 +156,11 @@ jobs:
- name: Build and publish seraing image to harbor
uses: IMIO/buildout.pm/actions/harbor@master
with:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
DELIB_HARBOR_USERNAME: ${{ secrets.DELIB_HARBOR_USERNAME }}
DELIB_HARBOR_PASSWORD: ${{ secrets.DELIB_HARBOR_PASSWORD }}
profile: seraing
tags: |
"imiobe/iadelib:seraing-${{ github.ref_name }}"
Expand Down
25 changes: 20 additions & 5 deletions actions/harbor/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: 'Build and publish to harbor'
description: 'Build and publish to dockerhub and IMIO container registry'
inputs:
DOCKERHUB_USERNAME:
description: 'DOCKERHUB_USERNAME'
required: true
DOCKERHUB_PASSWORD:
description: 'DOCKERHUB_PASSWORD'
required: true
HARBOR_URL:
description: 'HARBOR_URL'
required: true
DELIB_HARBOR_USERNAME:
description: 'DELIB_HARBOR_USERNAME'
required: true
DELIB_HARBOR_PASSWORD:
description: 'DELIB_HARBOR_PASSWORD'
required: true
profile:
description: 'Buildout profile'
required: true
Expand All @@ -24,14 +39,14 @@ runs:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ inputs.DOCKERHUB_PASSWORD }}
- name: Login to Harbor
uses: docker/login-action@v3
with:
registry: ${{ secrets.HARBOR_URL }}
username: ${{ secrets.DELIB_HARBOR_USERNAME }}
password: ${{ secrets.DELIB_HARBOR_PASSWORD }}
registry: ${{ inputs.HARBOR_URL }}
username: ${{ inputs.DELIB_HARBOR_USERNAME }}
password: ${{ inputs.DELIB_HARBOR_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand Down

0 comments on commit c92e4af

Please sign in to comment.