You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-1
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,65 @@ A GitHub Action to build and deploy Vuepress sites to GitHub Pages
3
3
4
4
This repository has been forked from @jenkey2011's [Vuepress deploy Github Action](https://github.com/jenkey2011/vuepress-deploy) to keep the code current and useful.
5
5
At the moment this is work in progress and not published at the [Github Marketplace](https://github.com/marketplace/) yet.
6
-
To use the [Vuepress deploy Github Action](https://github.com/marketplace/actions/vuepress-deploy) please refer to its current [README](https://github.com/jenkey2011/vuepress-deploy#).
6
+
7
+
To further use @jenkey2011's [Vuepress deploy Github Action](https://github.com/marketplace/actions/vuepress-deploy) please refer to its current [README](https://github.com/jenkey2011/vuepress-deploy#).
8
+
9
+
## Usage
10
+
Create `vuepress-deploy.yml` in the `.github/workflows` directory in the root of your repository.
11
+
12
+
```yml
13
+
name: Build and Deploy
14
+
on: [push]
15
+
jobs:
16
+
build-and-deploy:
17
+
runs-on: ubuntu-latest
18
+
steps:
19
+
- name: Checkout
20
+
uses: actions/checkout@master
21
+
22
+
- name: vuepress-deploy
23
+
uses: jenkey2011/vuepress-deploy@master
24
+
env:
25
+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
26
+
TARGET_REPO: username/repo
27
+
TARGET_BRANCH: master
28
+
BUILD_SCRIPT: yarn && yarn build
29
+
BUILD_DIR: blog/.vuepress/dist/
30
+
```
31
+
32
+
The action will auto deploy the vuepress project when you push your code. Enjoy!
| `TARGET_REPO` | The repository you want to deploy. e.g.:`jenkey2011/blog`. Default: **current repository** | `env` | **No** |
40
+
| `TARGET_BRANCH` | The branch you want to deploy. e.g.:`gh-pages`.Default: **gh-pages** | `env` | **No** |
41
+
| `TARGET_LINK` | The full address of the target repo will cover `TARGET_REPO` for other platforms. e.g.:`https://user:${{ secrets.CODING_TOKEN }}@team.coding.net/team/repo.git`. | `env` | **No** |
42
+
| `BUILD_SCRIPT` | The script to build the vuepress project. e.g.: `yarn && yarn build`| `env` | **Yes** |
43
+
| `BUILD_DIR` | The output of the build-script above. e.g.: `blog/.vuepress/dist/`| `env` | **Yes** |
44
+
| `COMMIT_MESSAGE` | The commit message supplied when pushing new changes e.g.: `Auto deploy from Github Actions`| `env` | **No** |
45
+
| `CNAME` | Alias Record of your site. | `env` | **No** |
46
+
47
+
48
+
## Step-by-Step Guide
49
+
50
+
### Create a personal access token
51
+
52
+
click your profile icon > Settings > Developer settings > Personal access tokens > Generate new token (Classic) > At least check `repo`. Then you will get a token, copy it.
53
+
54
+
### Creating encrypted secrets
55
+
56
+
Under your repository name, click Settings > Secrets > Type `ACCESS_TOKEN` in the "Name" input box && the the personal access token as value.
57
+
58
+
### Create a workflow file
59
+
If you repo doesn't already have one, create a workflow file. You must store workflows in the `.github/workflows` directory in the root of your repository.
60
+
61
+
In `.github/workflows`, add a `.yml` or `.yaml` file for your workflow. For example, `.github/workflows/vuepress-deploy.yml`.
62
+
63
+
**For more information**:
64
+
65
+
1. [Triggering new workflows using a personal access token](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token)
0 commit comments