forked from wowthemesnet/mediumish-vuepress-blog-theme
-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (35 loc) · 1.22 KB
/
deploy.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
name: Build and Deploy
on: [push, repository_dispatch]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout self
uses: actions/checkout@master
- name: Checkout blog
uses: actions/checkout@v2
with:
repository: ${{ secrets.REPO_BLOG }}
token: ${{ secrets.REPO_BLOG_ACCESS_TOKEN }}
path: blog
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Move blog/public/ to blog/.vuepress/
run: mv -f blog/public/ blog/.vuepress/public/
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: vuepress-deploy
uses: jenkey2011/vuepress-deploy@master
env:
ACCESS_TOKEN: ${{ secrets.REPO_HOSTING_ACCESS_TOKEN }}
TARGET_REPO: ${{ secrets.REPO_HOSTING }}
TARGET_BRANCH: main
BUILD_SCRIPT: yarn && yarn build
BUILD_DIR: blog/.vuepress/dist/
CNAME: ${{ secrets.CNAME }}