Skip to content

Commit d7e9c35

Browse files
committed
feat: kaniko trigger build
1 parent 25abb9f commit d7e9c35

File tree

1 file changed

+7
-40
lines changed

1 file changed

+7
-40
lines changed

.github/workflows/docker-builds.yml

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,13 @@ on:
77

88
jobs:
99

10-
ghcr-build-pg:
11-
runs-on: ubuntu-latest
12-
container:
13-
image: gcr.io/kaniko-project/executor:v1.23.0-debug
14-
options: --entrypoint /bin/sh
15-
permissions:
16-
packages: write
17-
18-
19-
steps:
20-
21-
22-
- name: Set branch name as environment variable
23-
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
24-
25-
- name: Set up Docker config for Kaniko
26-
run: |
27-
cat <<EOF > /kaniko/.docker/config.json
28-
{
29-
"auths": {
30-
"ghcr.io": {
31-
"auth": "$(echo -n "$GIT_USERNAME:$GIT_PASSWORD" | base64 -w0)"
32-
}
33-
}
34-
}
35-
EOF
36-
env:
37-
GIT_USERNAME: ${{ github.actor }}
38-
GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
39-
40-
41-
- name: Build and push pg
42-
run: |
43-
/kaniko/executor --dockerfile="Dockerfile" \
44-
--context="${{ github.repositoryUrl }}#${{ github.ref_name }}#${{ github.sha }}" \
45-
--destination="$GH_REGISTRY/$IMAGE_NAME:${GITHUB_REF_NAME}" \
4610

47-
env:
48-
GH_REGISTRY: "ghcr.io"
49-
IMAGE_NAME: "${{ github.repository }}/pg"
11+
trigger-build:
12+
uses: multi-repo/workflows/.github/workflows/kaniko-build.yml@main
13+
with:
14+
image-name: ${{ github.repository }}/pg
15+
secrets:
16+
personal_access_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
5017

5118

5219

@@ -63,7 +30,7 @@ jobs:
6330

6431

6532
deploy:
66-
needs: [trigger-cleanup, ghcr-build-pg]
33+
needs: [trigger-cleanup, trigger-build]
6734
runs-on: ubuntu-latest
6835
steps:
6936
- name: Deploy to environment

0 commit comments

Comments
 (0)