Skip to content
This repository was archived by the owner on May 25, 2024. It is now read-only.

Commit 524c92c

Browse files
committed
update: deploy yml
1 parent a239f3a commit 524c92c

File tree

2 files changed

+65
-69
lines changed

2 files changed

+65
-69
lines changed

.github/workflows/deploy.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: deploy documents
2+
3+
on:
4+
push:
5+
branches:
6+
- main # TODO:
7+
paths:
8+
- .github/workflows/vitepress.yml
9+
- 'packages/docs/**'
10+
workflow_dispatch:
11+
12+
permissions:
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
23+
runs-on: ubuntu-latest
24+
defaults:
25+
run:
26+
working-directory: docs
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Install pnpm
30+
uses: pnpm/action-setup@v2
31+
- name: Use Node.js
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: 20.x
35+
cache: pnpm
36+
- name: Setup
37+
run: npm i -g @antfu/ni
38+
- run: nci
39+
- run: nr docs build
40+
- run: echo 'handson.vuejs-jp.org' > CNAME
41+
working-directory: packages/docs/.vitepress/dist
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
name: dist
45+
path: packages/docs/.vitepress/dist
46+
47+
deploy:
48+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' # PR 時はデプロイを実行しない
49+
runs-on: ubuntu-latest
50+
needs: build
51+
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
56+
steps:
57+
- uses: actions/download-artifact@v3
58+
with:
59+
name: dist
60+
- uses: actions/upload-pages-artifact@v1
61+
with:
62+
path: .
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v1

.github/workflows/vitepress.yml

-69
This file was deleted.

0 commit comments

Comments
 (0)