Skip to content

Commit

Permalink
Merge branch 'dev' into releases/v4
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jun 26, 2022
2 parents 8817a56 + face238 commit 95ad738
Show file tree
Hide file tree
Showing 15 changed files with 291 additions and 404 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
- name: Install and Test
run: |
yarn install --frozen-lockfile
yarn lint
yarn lint:check
yarn lint:format:check
yarn test
- name: Uploade CodeCov Report
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2

- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Workflow dispatch event that pushes the current version to the release branch.
# From here the secondary production deployment workflow will trigger to build the dependencies.
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: releases/v4
folder: .
Expand Down
38 changes: 13 additions & 25 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ jobs:
uses: actions/checkout@v3

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
repository-name: MontezumaIves/lab
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
single-commit: true
clean: true
Expand All @@ -49,10 +48,9 @@ jobs:
uses: actions/checkout@v3

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma
git-config-name: Montezuma
Expand All @@ -63,7 +61,6 @@ jobs:
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages

# Deploys using checkout@v2 with a GITHUB_TOKEN.
integration-checkout-v2:
Expand All @@ -76,9 +73,8 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
target-folder: cat/montezuma2
silent: true
Expand All @@ -87,7 +83,6 @@ jobs:
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages

# Deploys using a container that requires you to install rsync.
integration-container:
Expand All @@ -108,9 +103,8 @@ jobs:
apt-get update && apt-get install -y rsync
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
target-folder: cat/montezuma2
silent: true
Expand All @@ -132,10 +126,9 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma3
silent: true
Expand All @@ -162,10 +155,9 @@ jobs:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: true
branch: gh-pages
folder: integration
target-folder: cat/montezuma4
silent: true
Expand All @@ -174,7 +166,6 @@ jobs:
uses: dawidd6/action-delete-branch@v3.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: gh-pages

# Deploys using a custom env. (Includes subsequent commit)
integration-env:
Expand All @@ -191,19 +182,17 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/montezuma4
silent: true

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: integration
target-folder: cat/subsequent
silent: true
Expand Down Expand Up @@ -233,10 +222,9 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
folder: integration
clean: true
silent: true
Expand All @@ -252,7 +240,7 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: integration-test-delete-prod
Expand All @@ -261,7 +249,7 @@ jobs:
silent: true

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: integration-test-delete-prod
Expand Down Expand Up @@ -289,7 +277,7 @@ jobs:
run: echo $RANDOM > integration/1

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
Expand All @@ -311,7 +299,7 @@ jobs:
run: echo $RANDOM > integration/2

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ jobs:
uses: actions/checkout@v3

- name: Generate Sponsors 馃挅
uses: JamesIves/github-sponsors-readme-action@v1.0.8
uses: JamesIves/github-sponsors-readme-action@v1
with:
token: ${{ secrets.PAT }}
file: 'README.md'
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="50px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
maximum: 9999
organization: true

- name: Generate Sponsors 馃挅
uses: JamesIves/github-sponsors-readme-action@v1.0.8
uses: JamesIves/github-sponsors-readme-action@v1
with:
token: ${{ secrets.PAT }}
file: 'README.md'
minimum: 10000
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="80px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
marker: 'premium'
organization: true

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.3.2
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: dev
folder: '.'
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When contributing to this repository, please first discuss the change you wish t
2. Ensure your change passes all of the integration tests.
3. Make sure you update the README if you've made a change that requires documentation.
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.
5. Make sure you've formatted and linted your code. You can do this by running `yarn format` and `yarn lint`.
5. Make sure you've linted and formatted your code. You can do this by running `yarn lint` and `yarn lint:format`.
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/).
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`.

Expand Down
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
</p>

<p align="center">
<!-- premium --><!-- premium -->
<!-- premium --><a href="https://github.com/github"><img src="https://github.com/github.png" width="80px" alt="github" /></a>&nbsp;&nbsp;<!-- premium -->
</p>

<p align="center">
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/milanpollock"><img src="https://github.com/milanpollock.png" width="50px" alt="milanpollock" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Chooksta69"><img src="https://github.com/Chooksta69.png" width="50px" alt="Chooksta69" /></a>&nbsp;&nbsp;<a href="https://github.com/robjtede"><img src="https://github.com/robjtede.png" width="50px" alt="robjtede" /></a>&nbsp;&nbsp;<a href="https://github.com/hadley"><img src="https://github.com/hadley.png" width="50px" alt="hadley" /></a>&nbsp;&nbsp;<a href="https://github.com/kevinchalet"><img src="https://github.com/kevinchalet.png" width="50px" alt="kevinchalet" /></a>&nbsp;&nbsp;<a href="https://github.com/Yousazoe"><img src="https://github.com/Yousazoe.png" width="50px" alt="Yousazoe" /></a>&nbsp;&nbsp;<!-- sponsors -->
</p>

## Getting Started :airplane:
Expand All @@ -59,6 +59,8 @@ You can view an example of this below.
```yml
name: Build and Deploy
on: [push]
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
Expand All @@ -73,9 +75,8 @@ jobs:
npm run build
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
```

Expand All @@ -90,6 +91,15 @@ on:

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).

#### Permission Settings 鈿狅笍

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.

```yml
permissions:
contents: write
```

#### Install as a Node Module 馃摝

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).
Expand All @@ -115,7 +125,6 @@ import run from '@jamesives/github-pages-deploy-action'

run({
token: process.env['ACCESS_TOKEN'],
branch: 'gh-pages',
folder: 'build',
repositoryName: 'JamesIves/github-pages-deploy-action',
silent: true,
Expand All @@ -135,7 +144,6 @@ The following options must be configured in order to make a deployment.

| Key | Value Information | Type | Required |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
| `branch` | This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. | `with` | **Yes** |
| `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** |

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.
Expand All @@ -149,6 +157,7 @@ By default, the action does not need any token configuration and uses the provid

| Key | Value Information | Type | Required |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
| `branch` | This is the branch you wish to deploy to, for example, `gh-pages` or `docs`. Defaults to `gh-pages`. | `with` | **No** |
| `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** |
| `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** |
| `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** |
Expand Down Expand Up @@ -192,9 +201,8 @@ With this configured, you can then set the `ssh-key` part of the action to your

```yml
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
ssh-key: ${{ secrets.DEPLOY_KEY }}
```
Expand Down Expand Up @@ -222,9 +230,8 @@ jobs:
npm run build
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build
clean: true
clean-exclude: |
Expand Down Expand Up @@ -258,6 +265,8 @@ If you're using an operating system such as [Windows](https://www.microsoft.com/
```yml
name: Build and Deploy
on: [push]
permissions:
contents: write
jobs:
build:
runs-on: windows-latest # The first job utilizes windows-latest
Expand Down Expand Up @@ -290,9 +299,8 @@ jobs:
name: site

- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
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.
```

Expand All @@ -311,7 +319,7 @@ If you use a [container](https://help.github.com/en/actions/automating-your-work
apt-get update && apt-get install -y rsync
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
```

---
Expand All @@ -325,6 +333,8 @@ If you're using a custom domain and require a `CNAME` file, or if you require th

```yml
name: Build and Deploy
permissions:
contents: write
on:
push:
branches:
Expand All @@ -343,9 +353,8 @@ jobs:
npm run build
- name: Deploy 馃殌
uses: JamesIves/github-pages-deploy-action@v4.3.0
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build
clean: true
clean-exclude: |
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ inputs:

branch:
description: 'This is the branch you wish to deploy to, for example gh-pages or docs.'
required: true
required: false
default: gh-pages

folder:
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.'
Expand Down

0 comments on commit 95ad738

Please sign in to comment.