-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 2.04 KB
/
build_bundle.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build Kustomize Bundle
on:
push:
branches:
- 'Kustomized-deployments'
- 'main'
paths:
- .github/**
- overlays/**
- base/**
jobs:
kustomize:
name: Build Kustomize Bundle
runs-on: ubuntu-latest
env:
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts
CI_COMMIT_AUTHOR: Continuous Integration
strategy:
matrix:
overlay:
- 'integration'
- 'integration-security'
- 'validation'
- 'validation-security'
steps:
- id: check-branch-exists
uses: GuillaumeFalourd/branch-exists@v1
with:
branch: 'deploy'
- if: steps.check-branch-exists.outputs.exists == 'false'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch --orphan deploy
git commit --allow-empty -m "Initial deploy commit"
git push -u origin deploy
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
- name: Kustomize Build
uses: karancode/kustomize-github-action@master
with:
kustomize_version: '5.4.0'
kustomize_build_dir: 'overlays/${{ matrix.overlay }}'
kustomize_comment: true
kustomize_output_file: "bundle/${{ matrix.overlay }}/${{ matrix.overlay }}.yaml"
token: ${{ github.token}}
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}
- name: Deploy
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: deploy
FOLDER: "bundle/${{ matrix.overlay }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET_DIR: "bundle/${{ matrix.overlay }}"