-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (82 loc) · 2.57 KB
/
pull-request.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
name: CI - Pull Request
on: pull_request
# Pull Request Runs on the same branch will be cancelled
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Check the code quality
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x.x
cache: "npm"
- name: Code Quality
uses: ZebraDevs/web-components-code-quality@action-setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
test-results-path: "src/test/test-results.xml"
generate-localizations:
name: Generate localizations.
needs: [code-quality]
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run lit-localize extract
run: npm run localize:extract
- name: Run lit-localize build
run: npm run localize:build
- name: Check diff
id: diff
run: git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit files
if: steps.diff.outputs.changed == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add .
git commit -m "Generated locales"
git push
deploy-preview:
timeout-minutes: 20
name: Deploy preview version of the storybook on firebase
needs: [generate-localizations]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Create custom-elements.json
run: npm run analyze
- name: Build storybook
run: npm run storybook:build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}"
expires: 7d
channelId: "pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}"