-
Notifications
You must be signed in to change notification settings - Fork 63
101 lines (94 loc) · 2.73 KB
/
ci_cd.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI/CD
on:
- push
- pull_request
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build_test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.3
bundler-cache: true
- run: bundle exec jekyll build
- run: bundle exec rake test_ci
- uses: actions/upload-artifact@v4
with:
name: _docs
retention-days: 7
path: |
_site/
firebase.json
build_test_devportal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ePages-de/epages-devportal
ref: master
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.3
bundler-cache: true
- run: bundle exec jekyll build
- run: bundle exec rake test_ci
- uses: actions/upload-artifact@v4
with:
name: _devportal
retention-days: 7
path: |
_site/
combine_projets:
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') }}
runs-on: ubuntu-latest
needs:
- build_test_devportal
- build_test_docs
steps:
- uses: actions/download-artifact@v4
with:
name: _docs
- uses: actions/download-artifact@v4
with:
name: _devportal
path: ./_devportal
- run: rsync -abviuzP _devportal/ _site/
- uses: actions/upload-artifact@v4
with:
name: _site
retention-days: 7
path: |
_site/
firebase.json
deploy_staging:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
needs:
- combine_projets
steps:
- uses: actions/download-artifact@v4
with:
name: _site
- run: curl -sL firebase.tools | bash
- run: firebase deploy --project $FIREBASE_PROJECT --token=$FIREBASE_TOKEN --non-interactive
env:
FIREBASE_PROJECT: ${{ secrets.FIREBASE_APP_NAME_STAGING }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
deploy_production:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs:
- combine_projets
steps:
- uses: actions/download-artifact@v4
with:
name: _site
- run: curl -sL firebase.tools | bash
- run: firebase deploy --project $FIREBASE_PROJECT --token=$FIREBASE_TOKEN --non-interactive
env:
FIREBASE_PROJECT: ${{ secrets.FIREBASE_APP_NAME_PRODUCTION }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}