build_application #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |