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
+49-37Lines changed: 49 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,49 +4,61 @@
4
4
5
5
This [GitHub action](https://github.com/features/actions) will handle the building and deploying process of your project to [GitHub Pages](https://pages.github.com/). It can be configured to upload your production ready code into any branch you'd like, including `gh-pages` and `docs`. This action is built on [Node](https://nodejs.org/en/), which means that you can call any optional build scripts your project requires prior to deploying.
6
6
7
+
❗️**You can find instructions for using version 1 of the GitHub Actions workflow format [here](https://github.com/JamesIves/github-pages-deploy-action/tree/1.1.3).**
8
+
7
9
## Getting Started :airplane:
8
-
You can include the action in your workflow to trigger on any event that [GitHub actions](https://github.com/features/actions) supports. If the remote branch that you wish to deploy to doesn't already exist the action will create it for you.
You can include the action in your workflow to trigger on any event that [GitHub actions](https://github.com/features/actions) supports. If the remote branch that you wish to deploy to doesn't already exist the action will create it for you.
11
+
12
+
Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work. You can view an example of this below.
13
+
14
+
```yml
15
+
name: Build and Deploy
16
+
on: [push]
17
+
jobs:
18
+
build-and-deploy:
19
+
runs-on: ubuntu-latest
20
+
steps:
21
+
- name: Checkout
22
+
uses: actions/checkout@master
23
+
24
+
- name: Build and Deploy
25
+
uses: JamesIves/github-pages-deploy-action@master
26
+
env:
27
+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
28
+
BRANCH: gh-pages
29
+
FOLDER: build
30
+
BUILD_SCRIPT: npm install && npm run-script build
20
31
```
21
32
22
-
If you'd like you can combine it with the filter action so it only triggers deploys on a specific branch. You can find an example of this below.
You can combine it with the filter action so it only triggers deploys on a specific branch.
34
+
35
+
```yml
36
+
name: Build and Deploy
37
+
on:
38
+
push:
39
+
branches:
40
+
- master
41
+
jobs:
42
+
build-and-deploy:
43
+
runs-on: ubuntu-latest
44
+
steps:
45
+
- name: Checkout
46
+
uses: actions/checkout@master
47
+
48
+
- name: Build and Deploy
49
+
uses: JamesIves/github-pages-deploy-action@master
50
+
env:
51
+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
52
+
BRANCH: gh-pages
53
+
FOLDER: build
54
+
BUILD_SCRIPT: npm install && npm run-script build
45
55
```
46
56
47
57
## Configuration 📁
48
58
49
-
The `secrets` and `env` portion of the workflow **must** be configured before the action will work. Below you'll find a description of what each one does.
59
+
The `env` portion of the workflow **must** be configured before the action will work. You can add these in the `env` section found in the examples above. Any `secrets` must be referenced using the bracket syntax and stored in the GitHub repositories `Settings/Secrets` menu. You can learn more about setting environment variables with GitHub actions [here](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsenv).
60
+
61
+
Below you'll find a description of what each option does.
@@ -59,6 +71,6 @@ The `secrets` and `env` portion of the workflow **must** be configured before th
59
71
| `COMMIT_EMAIL` | Used to sign the commit, this should be your email. If not provided it will default to your username. | `env` | **No** |
60
72
| `COMMIT_NAME` | Used to sign the commit, this should be your name. If not provided it will default to `username@users.noreply.github.com` | `env` | **No** |
61
73
62
-
With the action correctly configured you should see something similar to this in your GitHub actions workflow editor.
74
+
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
0 commit comments