-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 2.3 KB
/
deploy.yml
File metadata and controls
62 lines (55 loc) · 2.3 KB
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
name: Deploy to GitHub pages
# Controls when the action will run.
# In this case, when changes are made to the source branch
on:
push:
branches: [ src ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: work around permission issue
run: git config --global --add safe.directory /home/runner/work/SDMStudio.github.io/SDMStudio.github.io/public && ls && pwd
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Installs dependencies and generates static files inside the wwwroot folder
- name: Generate static vuepress files
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install
- run: npm run build
# Check for broken links (Doesnt play well with autogenerated pages for tags and blogpost listings)
# - run: npm install -g vuepress
# - run: vuepress check-md website
# Copy extra files to the wwwroot folder
# - run: |
# cp ./README.md ./wwwroot/README.md
# cp ./LICENSE ./wwwroot/LICENSE
# Create a fresh git repo in wwwroot
- name: Init new repo in dist and commit generated files
run: |
cd public
git init
git add -A
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'deploy'
# force push the contents of the wwwroot folder to the master branch
- name: Force push to master
uses: ad-m/github-push-action@v0.5.0
with:
# Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})
# repository: # optional, default is
# Destination branch to push changes
# branch: # optional, default is master
# Determines if force push is used
force: true
# Directory to change to before pushing.
directory: ./public