added secrets
This commit is contained in:
parent
92f8d11b76
commit
9201d5924b
2 changed files with 22 additions and 0 deletions
3
.github/workflows/build-docker-test.yml
vendored
3
.github/workflows/build-docker-test.yml
vendored
|
@ -4,3 +4,6 @@ jobs:
|
||||||
uses: ./.github/workflows/build-docker.yml
|
uses: ./.github/workflows/build-docker.yml
|
||||||
with:
|
with:
|
||||||
tag: 'forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/build/test:latest'
|
tag: 'forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/build/test:latest'
|
||||||
|
registry: 'forgejo.edf-bootstrap.cx.fg1.ffm.osc.live'
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
19
.github/workflows/build-docker.yml
vendored
19
.github/workflows/build-docker.yml
vendored
|
@ -17,6 +17,18 @@ on:
|
||||||
description: 'The tag to apply to the built image'
|
description: 'The tag to apply to the built image'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
registry:
|
||||||
|
description: 'The registry to push the image to'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
username:
|
||||||
|
description: 'The username to authenticate with the registry'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
password:
|
||||||
|
description: 'The password to authenticate with the registry'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-go:
|
build-go:
|
||||||
|
@ -26,6 +38,13 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
uses: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/checkout@main
|
uses: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/checkout@main
|
||||||
|
|
||||||
|
- name: Build Credentials File
|
||||||
|
run: |
|
||||||
|
mkdir -p /kaniko/.docker
|
||||||
|
AUTHSTRING=$(echo -n "${{ inputs.username }}:${{ inputs.password }}" | base64)
|
||||||
|
echo "{\"auths\":{\"${{ inputs.registry }}\":{\"auth\":\"${AUTHSTRING}\"}}}" > /kaniko/.docker/config.json
|
||||||
|
|
||||||
- name: Build Docker Container
|
- name: Build Docker Container
|
||||||
run: |
|
run: |
|
||||||
/kaniko/executor --dockerfile=${{ inputs.dockerfile }} --context=${{ inputs.context }} --destination=${{ inputs.tag }}
|
/kaniko/executor --dockerfile=${{ inputs.dockerfile }} --context=${{ inputs.context }} --destination=${{ inputs.tag }}
|
||||||
|
|
Loading…
Reference in a new issue