-
Notifications
You must be signed in to change notification settings - Fork 138
79 lines (72 loc) · 2.33 KB
/
frontend-checks.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
name: Frontend checks and lints
on:
push:
jobs:
frontend-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# set a PAT so that add-and-commit can trigger CI runs
token: ${{ secrets.GIX_BOT_PAT }}
- uses: ./.github/actions/setup-node
- run: npm ci
- name: Run tsc
run: npm run check
- name: Run ESLint
run: npm run lint
- name: Check formatting
run: npm run format-check
- uses: ./.github/actions/setup-didc
- name: Generate type interfaces
run: npm run generate
- name: Check for dapp logos
run: |
while read -r logo
do
if [ ! -f src/frontend/assets/icons/"$logo" ]
then
echo "Logo not found: $logo"
exit 1
fi
done < <(jq <src/frontend/src/flows/dappsExplorer/dapps.json -cMr '.[] | .logo' )
- name: Commit type interfaces
uses: EndBug/add-and-commit@v9
# We don't want to commit automatic changes to main
if: ${{ github.ref != 'refs/heads/main' }}
with:
add: src/frontend/generated
default_author: github_actions
message: "🤖 npm run generate auto-update"
# Deploy the showcase to GitHub Pages
showcase:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- run: npm ci
# Build the showcase with a special base URL (used in links and esp. routing)
# to match the deploy URL: https://dfinity.github.io/internet-identity/
- run: npm run build:showcase -- --base '/internet-identity/'
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'dist-showcase'
# Deploy the showcase to GitHub Pages
showcase-deploy:
runs-on: ubuntu-latest
needs: showcase
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
id: deployment