Skip to content

Commit dfea918

Browse files
committed
feat: build/push using skaffold
1 parent dc6ba2b commit dfea918

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

.github/workflows/build-images.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
name: 'Build Docker images'
2+
name: "Build Docker images"
33

44
on:
55
push:
66
branches:
77
- main
88
tags:
9-
- 'v*'
9+
- "v*"
1010
pull_request:
1111
branches:
1212
- main
@@ -73,18 +73,26 @@ jobs:
7373
username: ${{ github.actor }}
7474
password: ${{ secrets.GITHUB_TOKEN }}
7575

76+
- name: Set build env
77+
run: |
78+
echo "GIT_VERSION=${{ steps.version.outputs.git_version }}" >> $GITHUB_ENV
79+
echo "GIT_COMMIT=${{ steps.version.outputs.git_commit }}" >> $GITHUB_ENV
80+
echo "GIT_BRANCH=${{ steps.version.outputs.git_branch }}" >> $GITHUB_ENV
81+
7682
- name: Build and push
77-
uses: docker/build-push-action@v6
83+
uses: hiberbee/github-action[email protected]
7884
with:
79-
context: .
80-
file: Dockerfile
81-
platforms: linux/amd64,linux/arm64
85+
command: build
86+
skaffold-version: 2.16.1
8287
push: ${{ github.event_name != 'pull_request' }}
83-
tags: ${{ steps.docker_meta.outputs.tags }}
84-
build-args: |
85-
GIT_VERSION=${{ steps.version.outputs.git_version }}
86-
GIT_COMMIT=${{ steps.version.outputs.git_commit }}
87-
GIT_BRANCH=${{ steps.version.outputs.git_branch }}
88+
tag: ${{ steps.docker_meta.outputs.tags }}
89+
repository: ghcr.io/nuts-foundation/nuts-knooppunt
90+
file-output: artifacts.json
91+
92+
- uses: actions/upload-artifact@v4
93+
with:
94+
name: skaffold
95+
path: artifacts.json
8896

8997
- name: Build and push development image
9098
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}

skaffold.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: skaffold/v4beta13
2+
kind: Config
3+
build:
4+
platforms:
5+
- linux/amd64
6+
- linux/arm64
7+
artifacts:
8+
- image: nuts-knooppunt
9+
context: .
10+
docker:
11+
buildArgs:
12+
GIT_VERSION: "${GIT_VERSION}"
13+
GIT_COMMIT: "${GIT_COMMIT}"
14+
GIT_BRANCH: "${GIT_BRANCH}"

0 commit comments

Comments
 (0)