forked from chilli-axe/mpc-autofill
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.13 KB
/
Copy pathbuild-frontend.yml
File metadata and controls
67 lines (67 loc) · 2.13 KB
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
name: Frontend build
on:
push:
branches: [frontend-release]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install npm
uses: actions/setup-node@v6
with:
node-version: 22.15
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install packages
working-directory: frontend
run: |
npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ hashFiles('frontend/package-lock.json') }}
- name: Install Playwright Browsers
run: |
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" = "true" ]; then
npx playwright install-deps
else
npx playwright install --with-deps
fi
working-directory: frontend
shell: bash
- name: Run Jest tests
working-directory: frontend
run: |
npm run test
shell: bash
- name: Run Playwright tests
run: |
npm run test-e2e
working-directory: frontend
shell: bash
- name: Build frontend
working-directory: frontend
run: |
npx next build
env:
NEXT_PUBLIC_IMAGE_BUCKET_URL: ${{ secrets.IMAGE_CDN_BUCKET_DOMAIN }}
NEXT_PUBLIC_IMAGE_WORKER_URL: ${{ secrets.IMAGE_CDN_WORKER_DOMAIN }}
NEXT_PUBLIC_GOOGLE_DRIVE_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_GOOGLE_DRIVE_CLIENT_ID }}
NEXT_PUBLIC_GOOGLE_DRIVE_APP_ID: ${{ secrets.NEXT_PUBLIC_GOOGLE_DRIVE_APP_ID }}
- name: Publish frontend to GitHub Pages repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: "frontend/out/."
destination_repo: "mpcautofill/mpcautofill.github.io"
user_email: "chilli.axe@gmail.com"
user_name: "chilli-axe"