-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b668cf
commit 251d958
Showing
5 changed files
with
242 additions
and
123 deletions.
There are no files selected for viewing
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,22 @@ | ||
name: Test workflow examples | ||
|
||
on: | ||
push: | ||
branches: [trunk] | ||
# TODO: remove | ||
pull_request: | ||
branches: [trunk] | ||
|
||
jobs: | ||
test-examples: | ||
name: Test examples | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test 'build-deploy.yml' | ||
uses: ./examples/build-deploy.yml | ||
|
||
- name: Test 'build-deploy-google.yml' | ||
uses: ./examples/build-deploy-google.yml |
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
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,112 @@ | ||
name: Build and deploy to Kubernetes on Google Cloud | ||
|
||
on: | ||
push: | ||
branches: [trunk] | ||
pull_request: | ||
branches: [trunk] | ||
# NOTE: this is for internal testing, remove this line when copying to your project | ||
workflow_call: | ||
# NOTE: this is for internal testing, remove this line when copying to your project | ||
|
||
env: | ||
APPLICATION_NAME: 'demo-api' | ||
SYSTEM_NAMESPACE: 'core' | ||
|
||
jobs: | ||
unittests: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
checks: write | ||
issues: read | ||
pull-requests: write | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/unittest@trunk | ||
|
||
analyze: | ||
name: Run CodeQL analysis | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/unittest@trunk | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
environment: build | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/build@trunk | ||
with: | ||
name: ${{ env.APPLICATION_NAME }} | ||
namespace: ${{ env.SYSTEM_NAMESPACE }} | ||
dockerfile: '.github/test/src/Dockerfile' | ||
AZURE_CLIENT_ID: ${{ vars.ACR_CLIENT_ID }} | ||
|
||
deploy-dev: | ||
name: Deploy to dev | ||
needs: [build, analyze] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
environment: dev | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/deploy@trunk | ||
with: | ||
name: ${{ env.APPLICATION_NAME }} | ||
namespace: ${{ env.SYSTEM_NAMESPACE }} | ||
environment: 'dev' | ||
helm-values-path: '.github/test/deploy/values.yaml' | ||
runtime-cloud-provider: 'GKE' | ||
GC_SERVICE_ACCOUNT: ${{ vars.GC_SERVICE_ACCOUNT }} | ||
GC_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GC_WORKLOAD_IDENTITY_PROVIDER }} | ||
|
||
deploy-test: | ||
name: Deploy to test | ||
needs: [deploy-dev] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
environment: test | ||
# Only on push to trunk | ||
if: github.ref == 'refs/heads/trunk' | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/deploy@trunk | ||
with: | ||
name: ${{ env.APPLICATION_NAME }} | ||
namespace: ${{ env.SYSTEM_NAMESPACE }} | ||
environment: 'prod' | ||
helm-values-path: '.github/test/deploy/values.yaml' | ||
runtime-cloud-provider: 'GKE' | ||
GC_SERVICE_ACCOUNT: ${{ vars.GC_SERVICE_ACCOUNT }} | ||
GC_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GC_WORKLOAD_IDENTITY_PROVIDER }} | ||
|
||
deploy-prod: | ||
name: Deploy to prod | ||
needs: [deploy-test] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
environment: test | ||
# Only on push to trunk | ||
if: github.ref == 'refs/heads/trunk' | ||
steps: | ||
- uses: 3lvia/core-github-actions-templates/deploy@trunk | ||
with: | ||
name: ${{ env.APPLICATION_NAME }} | ||
namespace: ${{ env.SYSTEM_NAMESPACE }} | ||
environment: 'prod' | ||
helm-values-path: '.github/test/deploy/values.yaml' | ||
runtime-cloud-provider: 'GKE' | ||
GC_SERVICE_ACCOUNT: ${{ vars.GC_SERVICE_ACCOUNT }} | ||
GC_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GC_WORKLOAD_IDENTITY_PROVIDER }} |
Oops, something went wrong.