-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.36 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CI/CD Workflow 🚀
on:
push:
release:
types:
- published
workflow_dispatch:
inputs:
environment:
description: "Environment to run deploy"
type: environment
required: true
force:
description: "Deploy even if tests fail"
type: boolean
required: false
default: false
jobs:
test:
name: Test 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests
run: |
echo "Mock testing..."
deploy-to-staging:
name: Deploy to Staging
needs: test
if: github.event_name == 'push' && github.ref_name == 'main'
concurrency: staging
uses: "./.github/workflows/deploy.yml"
with:
environment: staging
secrets: inherit
deploy-to-production:
name: Deploy to Production
needs: test
if: github.event_name == 'release'
concurrency: production
uses: "./.github/workflows/deploy.yml"
with:
environment: production
secrets: inherit
manual-deployment:
name: Manual Deployment
needs: test
if: github.event_name == 'workflow_dispatch' && (success() || inputs.force == true)
concurrency: ${{ inputs.environment }}
uses: "./.github/workflows/deploy.yml"
with:
environment: ${{ inputs.environment }}
secrets: inherit