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: CONTRIBUTING.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ When contributing to this repository, please first discuss the change you wish t
9
9
2. Ensure your change passes all of the integration tests.
10
10
3. Make sure you update the README if you've made a change that requires documentation.
11
11
4. When making a pull request, highlight any areas that may cause a breaking change so the maintainer can update the version number accordingly on the GitHub marketplace and package registries.
12
-
5. Make sure you've formatted and linted your code. You can do this by running `yarn format` and `yarn lint`.
12
+
5. Make sure you've linted and formatted your code. You can do this by running `yarn lint` and `yarn lint:format`.
13
13
6. Fix or add any tests where applicable. You can run `yarn test` to run the suite. As this action is small in scope it's important that a high level of test coverage is maintained. All tests are written using [Jest](https://jestjs.io/).
14
14
7. As this package is written in [TypeScript](https://www.typescriptlang.org/) please ensure all typing is accurate and the action compiles correctly by running `yarn build`.
@@ -59,6 +59,8 @@ You can view an example of this below.
59
59
```yml
60
60
name: Build and Deploy
61
61
on: [push]
62
+
permissions:
63
+
contents: write
62
64
jobs:
63
65
build-and-deploy:
64
66
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
@@ -73,9 +75,8 @@ jobs:
73
75
npm run build
74
76
75
77
- name: Deploy 🚀
76
-
uses: JamesIves/github-pages-deploy-action@v4.3.0
78
+
uses: JamesIves/github-pages-deploy-action@v4
77
79
with:
78
-
branch: gh-pages # The branch the action should deploy to.
79
80
folder: build # The folder the action should deploy.
80
81
```
81
82
@@ -90,6 +91,15 @@ on:
90
91
91
92
It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically) to keep your workflow up-to-date and [secure](https://github.com/features/security). You can find the latest tagged version on the [GitHub Marketplace](https://github.com/marketplace/actions/deploy-to-github-pages) or on the [releases page](https://github.com/JamesIves/github-pages-deploy-action/releases).
92
93
94
+
#### Permission Settings ⚠️
95
+
96
+
If you do not supply the action with an access token or an SSH key, you must access your repositories settings and provide `Read and Write Permissions` to the provided `GITHUB_TOKEN`, otherwise you'll potentailly run into permission issues. Alternatively you can set the following in your workflow file to grant the action the permissions it needs.
97
+
98
+
```yml
99
+
permissions:
100
+
contents: write
101
+
```
102
+
93
103
#### Install as a Node Module 📦
94
104
95
105
If you'd like to use the functionality provided by this action in your own action you can either [create a composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action), or you can install it using [yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/get-npm) by running the following commands. It's available on both the [npm](https://www.npmjs.com/package/@jamesives/github-pages-deploy-action) and [GitHub registry](https://github.com/JamesIves/github-pages-deploy-action/packages/229985).
@@ -115,7 +125,6 @@ import run from '@jamesives/github-pages-deploy-action'
|`branch`| This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. |`with`|**Yes**|
139
147
|`folder`| The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. If you wish to deploy the root directory you can place a `.` here. You can also utilize absolute file paths by appending `~` to your folder path. |`with`|**Yes**|
140
148
141
149
By default, the action does not need any token configuration and uses the provided repository scoped GitHub token to make the deployment. If you require more customization you can modify the deployment type using the following options.
@@ -149,6 +157,7 @@ By default, the action does not need any token configuration and uses the provid
|`branch`| This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. Defaults to `gh-pages`. |`with`|**No**|
152
161
|`git-config-name`| Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. |`with`|**No**|
153
162
|`git-config-email`| Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. |`with`|**No**|
154
163
|`repository-name`| Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: `JamesIves/github-pages-deploy-action`. You'll need to use a PAT in the `token` input for this configuration option to work properly. |`with`|**No**|
@@ -192,9 +201,8 @@ With this configured, you can then set the `ssh-key` part of the action to your
192
201
193
202
```yml
194
203
- name: Deploy 🚀
195
-
uses: JamesIves/github-pages-deploy-action@v4.3.0
204
+
uses: JamesIves/github-pages-deploy-action@v4
196
205
with:
197
-
branch: gh-pages
198
206
folder: site
199
207
ssh-key: ${{ secrets.DEPLOY_KEY }}
200
208
```
@@ -222,9 +230,8 @@ jobs:
222
230
npm run build
223
231
224
232
- name: Deploy 🚀
225
-
uses: JamesIves/github-pages-deploy-action@v4.3.0
233
+
uses: JamesIves/github-pages-deploy-action@v4
226
234
with:
227
-
branch: gh-pages
228
235
folder: build
229
236
clean: true
230
237
clean-exclude: |
@@ -258,6 +265,8 @@ If you're using an operating system such as [Windows](https://www.microsoft.com/
258
265
```yml
259
266
name: Build and Deploy
260
267
on: [push]
268
+
permissions:
269
+
contents: write
261
270
jobs:
262
271
build:
263
272
runs-on: windows-latest # The first job utilizes windows-latest
@@ -290,9 +299,8 @@ jobs:
290
299
name: site
291
300
292
301
- name: Deploy 🚀
293
-
uses: JamesIves/github-pages-deploy-action@v4.3.0
302
+
uses: JamesIves/github-pages-deploy-action@v4
294
303
with:
295
-
branch: gh-pages
296
304
folder: 'site' # The deployment folder should match the name of the artifact. Even though our project builds into the 'build' folder the artifact name of 'site' must be placed here.
297
305
```
298
306
@@ -311,7 +319,7 @@ If you use a [container](https://help.github.com/en/actions/automating-your-work
311
319
apt-get update && apt-get install -y rsync
312
320
313
321
- name: Deploy 🚀
314
-
uses: JamesIves/github-pages-deploy-action@v4.3.0
322
+
uses: JamesIves/github-pages-deploy-action@v4
315
323
```
316
324
317
325
---
@@ -325,6 +333,8 @@ If you're using a custom domain and require a `CNAME` file, or if you require th
Copy file name to clipboardexpand all lines: action.yml
+2-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,8 @@ inputs:
33
33
34
34
branch:
35
35
description: 'This is the branch you wish to deploy to, for example gh-pages or docs.'
36
-
required: true
36
+
required: false
37
+
default: gh-pages
37
38
38
39
folder:
39
40
description: 'The folder in your repository that you want to deploy. If your build script compiles into a directory named build you would put it here. Folder paths cannot have a leading / or ./. If you wish to deploy the root directory you can place a . here.'
0 commit comments