-
Notifications
You must be signed in to change notification settings - Fork 8
83 lines (58 loc) · 2.03 KB
/
build-push-next.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
name: Next Build Deploy Test Push
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
GH_TOKEN: ${{secrets.PULL_REQ}}
on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight
workflow_dispatch: # Allows manual triggering
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: eelab-dev/EEcircuit
ref: next # Checkout the "next" branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create Empty Build Directory
run: mkdir -p Docker/build
#- name: Build Docker Image
#run: docker build --no-cache -t eecircuit ./Docker
#- name: Run Docker Container
#run: docker run -t -v $(realpath ./Docker):/mnt eecircuit
#- name: Run Inject.js
#run: node ./Docker/inject.js
#- name: Rename and Copy Files to Main Directory
#run: |
#cp ./Docker/build/spice.wasm ./src/sim/spice.wasm
#cp ./Docker/build/spice-eesim.js ./src/sim/spice.js
- name: Update Dependencies
run: npx --yes npm-check-updates -u
- name: Install Dependencies
run: npm install
- name: Build Project with Vite
run: npm run build
- name: Deploy to Vercel
run: npx vercel --token=${{ secrets.VERCEL_TOKEN }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test -g "EEcircuit Next"
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
# auto commit
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto updates after tests