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 Jan 31, 2022
2 parents 2731bec + 91d4e8f commit 0752a8c
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 123 deletions.
26 changes: 12 additions & 14 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
// https://github.com/microsoft/vscode-dev-containers/tree/master/containers/typescript-node
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"dbaeumer.vscode-eslint"
],
"remoteUser": "node"
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "14"
}
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": ["dbaeumer.vscode-eslint"],
"remoteUser": "node"
}
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install and Test
run: |
yarn install
yarn install --frozen-lockfile
yarn lint
yarn test
Expand All @@ -51,12 +51,12 @@ jobs:

- name: Build lib
run: |
yarn install
yarn install --frozen-lockfile
yarn build
- name: Rebuild production node_modules
run: |
yarn install --production
yarn install --production --frozen-lockfile
ls node_modules
- name: artifact
Expand Down
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@4.2.1
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: releases/v4
folder: .
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v2.4.0

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: Montezuma
git-config-email: montezuma@jamesiv.es
Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v1

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
Expand All @@ -71,7 +71,7 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
apt-get update && apt-get install -y rsync
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: integration
Expand All @@ -127,7 +127,7 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: true
branch: gh-pages
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
Expand All @@ -195,7 +195,7 @@ jobs:
silent: true

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
Expand All @@ -218,7 +218,7 @@ jobs:
integration-container,
integration-ssh,
integration-ssh-third-party-client,
integration-env,
integration-env
]
runs-on: ubuntu-latest
steps:
Expand All @@ -228,7 +228,7 @@ jobs:
persist-credentials: false

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: gh-pages
Expand All @@ -247,7 +247,7 @@ jobs:
persist-credentials: false

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

- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
branch: integration-test-delete-prod
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
- name: Build
run: |
yarn install
yarn install --frozen-lockfile
yarn build
- name: Install Production node_modules
run: |
yarn install --production
yarn install --production --frozen-lockfile
- name: Commit and Push
# Keep the run green if the commit fails for the lack of changes
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/sponsors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ jobs:
uses: actions/checkout@v2.4.0

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

- name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@v1.0.8
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'

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.2.1
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: dev
folder: '.'
4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Update Major Version Tag
on:
push:
tags:
- "v*"
- 'v*'

jobs:
update-majorver:
name: Update Major Version Tag
runs-on: ubuntu-latest
steps:
- uses: nowactions/update-majorver@v1
- uses: nowactions/update-majorver@v1.1.2
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/marketplace/actions/deploy-to-github-pages">
<img alt="" width="200px" src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/.github/assets/icon.png">
<img alt="GitHub Pages Deploy Action Logo" width="200px" src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/.github/assets/icon.png">
</a>
</p>

Expand Down Expand Up @@ -35,12 +35,24 @@
</p>

<p align="center">
<img src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/.github/assets/screenshot.png">
<img src="https://github.com/JamesIves/github-pages-deploy-action/raw/dev/.github/assets/screenshot.png" alt="">
</p>

<p align="center">
Maintainence of this project is made possible by all the <a href="https://github.com/JamesIves/github-pages-deploy-action/graphs/contributors">contributors</a> and <a href="https://github.com/sponsors/JamesIves">sponsors</a>. If you'd like to sponsor this project and have your avatar or company logo appear below <a href="https://github.com/sponsors/JamesIves">click here</a>. 💖
</p>

<p align="center">
<!-- premium --><!-- 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 -->
</p>

## Getting Started :airplane:

You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work.
You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work. If you intend to make multiple deployments in quick succession [you may need to levereage the concurrency parameter in your workflow](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency) to prevent overlaps.

You can view an example of this below.

Expand All @@ -49,10 +61,11 @@ name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.5.1
uses: actions/checkout@v2

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
Expand Down Expand Up @@ -196,10 +209,11 @@ on:
- main
jobs:
deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.5.1
uses: actions/checkout@v2

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
Expand Down Expand Up @@ -248,7 +262,7 @@ jobs:
runs-on: windows-latest # The first job utilizes windows-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.5.1
uses: actions/checkout@v2
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
Expand All @@ -262,11 +276,12 @@ jobs:
path: build
deploy:
concurrency: ci-${{ github.ref }}
needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.5.1
uses: actions/checkout@v2
- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v1
Expand Down Expand Up @@ -315,10 +330,11 @@ on:
- main
jobs:
deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.5.1
uses: actions/checkout@v2
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
Expand All @@ -340,11 +356,3 @@ jobs:
</details>

If you wish to remove these files you must go into the deployment branch directly to remove them. This is to prevent accidental changes in your deployment script from creating breaking changes.

---

## Support 💖

This project would not be possible without all of our fantastic [contributors](https://github.com/JamesIves/github-pages-deploy-action/graphs/contributors) and [sponsors](https://github.com/sponsors/JamesIves). If you'd like to support the maintenance and upkeep of this project you can [donate via GitHub Sponsors](https://github.com/sponsors/JamesIves).

<!-- sponsors --><a href="https://github.com/milanpollock"><img src="https://github.com/milanpollock.png" width="50px" alt="" /></a><a href="https://github.com/raoulvdberge"><img src="https://github.com/raoulvdberge.png" width="50px" alt="" /></a><!-- sponsors -->
1 change: 1 addition & 0 deletions __tests__/env.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
process.env.ACTIONS_STEP_DEBUG = 'false'
process.env.RUNNER_OS = 'Windows'
4 changes: 3 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ process.env['INPUT_FOLDER'] = 'build'
process.env['GITHUB_SHA'] = '123'
process.env['INPUT_DEBUG'] = 'debug'
process.env['GITHUB_REF_NAME'] = 'test'
process.env['RUNNER_OS'] = 'Linux'

import '../src/main'
import {action, TestFlag} from '../src/constants'
Expand All @@ -27,7 +28,8 @@ jest.mock('@actions/core', () => ({
setOutput: jest.fn(),
exportVariable: jest.fn(),
isDebug: jest.fn(),
info: jest.fn()
info: jest.fn(),
notice: jest.fn()
}))

describe('main', () => {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('util', () => {
checkParameters(action)
} catch (e) {
expect(e instanceof Error && e.message).toMatch(
'No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true.'
'No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. For more details on how to use an ssh deploy key please refer to the documentation.'
)
}
})
Expand All @@ -244,7 +244,7 @@ describe('util', () => {
checkParameters(action)
} catch (e) {
expect(e instanceof Error && e.message).toMatch(
'No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true.'
'No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. For more details on how to use an ssh deploy key please refer to the documentation.'
)
}
})
Expand Down
Loading

0 comments on commit 0752a8c

Please sign in to comment.