-
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
7f8662e
commit 314c90a
Showing
2 changed files
with
82 additions
and
0 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,39 @@ | ||
name: Protected envs and stages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout github repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build or simulate building | ||
run: sleep 5 | ||
|
||
- name: Finish building | ||
run: echo "Build completed successfully" | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: [build-and-push] | ||
strategy: | ||
matrix: | ||
environment: ['dev', 'int'] | ||
environment: ${{ matrix.environment}} | ||
steps: | ||
- name: Checkout github repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Print environment | ||
run: echo "Deploying to environment ${{ matrix.environment}}" | ||
|
||
- name: Simulate deployment | ||
run: sleep 5 | ||
|
||
- name: Finish deployment | ||
run: echo "Deployment completed successfully" |
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,43 @@ | ||
name: Protected envs and stages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout github repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build or simulate building | ||
run: sleep 5 | ||
|
||
- name: Finish building | ||
run: echo "Build completed successfully" | ||
|
||
deploy-to-environments: | ||
needs: build-and-push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout github repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Deploy to environments | ||
uses: github/deployments@v1 | ||
with: | ||
environments: | | ||
dev | ||
int | ||
prd | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }} | ||
strategy: | ||
type: sequential | ||
approvals: | ||
required: true | ||
on_failure: | ||
continue: never |