Skip to content

Commit 88fbf5f

Browse files
committed
Trigger deployment on push to main and release
1 parent d9027d6 commit 88fbf5f

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/cicd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI/CD Workflow
2+
3+
on:
4+
push:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Run tests
17+
run: |
18+
echo "TODO: Replace this with actual tests"
19+
20+
deploy-to-staging:
21+
needs: test
22+
if: github.ref_name == 'main'
23+
concurrency: staging
24+
uses: "./.github/workflows/deploy.yml"
25+
with:
26+
environment: staging
27+
secrets: inherit
28+
29+
deploy-to-production:
30+
needs: test
31+
if: github.ref_name == 'production'
32+
concurrency: production
33+
uses: "./.github/workflows/deploy.yml"
34+
with:
35+
environment: production
36+
secrets: inherit

.github/workflows/_deploy.yml renamed to .github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# A reusable workflow that deploys the contents of a repository to a target environment.
2+
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
23

3-
name: Deploy
4+
name: Deployment Workflow
45

56
permissions:
67
id-token: write

0 commit comments

Comments
 (0)