-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement the on branch workflow (#58)
- Loading branch information
1 parent
20a057d
commit 2238866
Showing
30 changed files
with
675 additions
and
372 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build on branch | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "main" | ||
|
||
jobs: | ||
cli: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref_name }} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ inputs.GO_VERSION }} | ||
|
||
- name: build and deploy on pr | ||
run: go run main.go onbranch --stop-on-push | ||
env: | ||
KKA_APP_NAME: k8s-kurated-addons-cli | ||
KKA_REGISTRY_USER: ${{ github.actor }} | ||
KKA_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Deploy on main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
cli: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ inputs.GO_VERSION }} | ||
|
||
- name: build and deploy on main | ||
run: go run main.go onmain --stop-on-push | ||
env: | ||
KKA_APP_NAME: k8s-kurated-addons-cli | ||
KKA_REGISTRY_USER: ${{ github.actor }} | ||
KKA_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
.env | ||
Dockerfile.kka | ||
*.init_test* | ||
kka_on_main.yaml | ||
kka_onmain.yaml | ||
kka_onbranch.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This file is generate by https://github.com/nearform/k8s-kurated-addons-cli | ||
name: Deploy on PR | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
|
||
jobs: | ||
on_pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: delete application | ||
if: github.event.type == "closed" | ||
uses: docker://ghcr.io/nearform/k8s-kurated-addons-cli:latest | ||
with: | ||
args: onbranch --clean | ||
env: | ||
KKA_APP_NAME: {{ .AppName }} | ||
KKA_PROJECT_DIRECTORY: {{ .ProjectDirectory }} | ||
KKA_REPO_NAME: {{ .Repository }} | ||
KKA_REGISTRY_USER: {{ `${{ github.actor }}` }} | ||
KKA_REGISTRY_PASSWORD: {{ `${{ secrets.GITHUB_TOKEN }}` }} | ||
KKA_CLUSTER_ENDPOINT: {{ `${{ secrets.CLUSTER_ENDPOINT }}` }} | ||
KKA_CLUSTER_TOKEN: {{ `${{ secrets.CLUSTER_TOKEN }}` }} | ||
KKA_CLUSTER_CA_CERT: {{ `${{ secrets.CLUSTER_CA_CERT }}` }} | ||
|
||
- name: build and deploy application | ||
if: github.event.type != "closed" | ||
uses: docker://ghcr.io/nearform/k8s-kurated-addons-cli:latest | ||
with: | ||
args: onbranch | ||
env: | ||
KKA_APP_NAME: {{ .AppName }} | ||
KKA_PROJECT_DIRECTORY: {{ .ProjectDirectory }} | ||
KKA_REPO_NAME: {{ .Repository }} | ||
KKA_REGISTRY_USER: {{ `${{ github.actor }}` }} | ||
KKA_REGISTRY_PASSWORD: {{ `${{ secrets.GITHUB_TOKEN }}` }} | ||
KKA_CLUSTER_ENDPOINT: {{ `${{ secrets.CLUSTER_ENDPOINT }}` }} | ||
KKA_CLUSTER_TOKEN: {{ `${{ secrets.CLUSTER_TOKEN }}` }} | ||
KKA_CLUSTER_CA_CERT: {{ `${{ secrets.CLUSTER_CA_CERT }}` }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.