-
Notifications
You must be signed in to change notification settings - Fork 46
50 lines (47 loc) · 1.2 KB
/
nuxt.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
name: Test and Deploy Github Pages with Nuxt
on:
pull_request:
paths:
- 'nuxt/**'
- '.github/workflows/*nuxt*.yml'
push:
branches: master
paths:
- 'nuxt/**'
- '.github/workflows/*nuxt*.yml'
jobs:
test:
runs-on: [ubuntu-latest]
defaults:
run:
working-directory: nuxt
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: 'nuxt/yarn.lock'
- run: yarn
- run: yarn lint
- run: yarn test
deploy:
if: github.ref == 'refs/heads/master'
needs: test
defaults:
run:
working-directory: nuxt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: 'nuxt/yarn.lock'
- name: yarn
run: yarn
- name: deploy
run: yarn deploy -r "https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" -u "github-actions-bot <support+actions@github.com>" -m "$GITHUB_SHA"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}