Skip to content

Commit bef63dc

Browse files
committed
add githup action
1 parent 3e8bf77 commit bef63dc

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master ]
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
# This workflow contains a single job called "build"
14+
build:
15+
# The type of runner that the job will run on
16+
runs-on: ubuntu-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
- uses: actions/checkout@v2
22+
with:
23+
persist-credentials: false
24+
25+
# Runs a set of commands using the runners shell
26+
- name: Run a multi-line script
27+
run: |
28+
npm install --dev
29+
npm run build-website
30+
31+
# The project is then uploaded as an artifact named 'site'.
32+
- name: Upload Artifacts
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: site
36+
path: gh-pages
37+
38+
deploy:
39+
needs: [build]
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout 🛎️
43+
uses: actions/checkout@v2
44+
with:
45+
persist-credentials: false
46+
47+
# The built project is downloaded into the 'site' folder.
48+
- name: Download Artifacts
49+
uses: actions/download-artifact@v1
50+
with:
51+
name: site
52+
53+
# Deploy
54+
- name: Deploy to GitHub Pages
55+
uses: JamesIves/github-pages-deploy-action@3.5.2
56+
with:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
BRANCH: gh-pages # The branch the action should deploy to.
59+
FOLDER: "site" # The folder the action should deploy.

0 commit comments

Comments
 (0)