Skip to content

Commit

Permalink
Fix comment & conditional job running
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Aug 19, 2024
1 parent a77e743 commit 48e72db
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/example-build-deploy-dotnet-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:

deploy-dev:
name: Deploy Dev
# Required these jobs to be successful before running this job.
# Any of these can be commented out if you want to deploy anyway.
# Require all jobs below to be successful before running this job.
# Any of these can be commented out or removed if you want to deploy anyway.
needs:
- unit-tests
- integration-tests
Expand All @@ -83,7 +83,7 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -106,7 +106,7 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -129,7 +129,7 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example-build-deploy-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:

deploy-dev:
name: Deploy Dev
# Required these jobs to be successful before running this job.
# Any of these can be commented out if you want to deploy anyway.
# Require all jobs below to be successful before running this job.
# Any of these can be commented out or removed if you want to deploy anyway.
needs:
- unit-tests
- integration-tests
Expand All @@ -83,7 +83,7 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -104,7 +104,7 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -125,7 +125,7 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example-build-deploy-go-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:

deploy-dev:
name: Deploy Dev
# Required these jobs to be successful before running this job.
# Any of these can be commented out if you want to deploy anyway.
# Require all jobs below to be successful before running this job.
# Any of these can be commented out or removed if you want to deploy anyway.
needs:
- build-scan
- analyze
Expand All @@ -54,7 +54,7 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -77,7 +77,7 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -100,7 +100,7 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example-build-deploy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:

deploy-dev:
name: Deploy Dev
# Required these jobs to be successful before running this job.
# Any of these can be commented out if you want to deploy anyway.
# Require all jobs below to be successful before running this job.
# Any of these can be commented out or removed if you want to deploy anyway.
needs:
- build-scan
- analyze
Expand All @@ -54,7 +54,7 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -75,7 +75,7 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand All @@ -96,7 +96,7 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to trunk
# Only on push to $default-branch
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-starter-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
sed -i "s/ SYSTEM_NAME: 'core'/ SYSTEM_NAME: '<your system name here>'/g" "$new_workflow_path"
sed -i "s/ HELM_VALUES_PATH: '.*'/ HELM_VALUES_PATH: '.github\/deploy\/values.yml'/g" "$new_workflow_path"
sed -i "s/ PROJECT_FILE: '.*'/ PROJECT_FILE: '<your project file path here>'/g" "$new_workflow_path"
sed -i "s/refs\/heads\/trunk/$default-branch/g" "$new_workflow_path"
sed -i "s/# pull_request:/ pull_request:/g" "$new_workflow_path"
sed -i "s/# branches: \[trunk\]/ branches: \[trunk\]/g" "$new_workflow_path"
sed -i 's/branches: \[trunk\]/branches: \[$default-branch\]/g' "$new_workflow_path"
Expand Down

0 comments on commit 48e72db

Please sign in to comment.