mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Merge branch 'dev' into releases/v4
This commit is contained in:
commit
fd3cf89aa3
@ -1,2 +1,2 @@
|
||||
ARG VARIANT=12
|
||||
ARG VARIANT=14
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT}
|
@ -1,4 +1,4 @@
|
||||
ARG VARIANT=12-buster
|
||||
ARG VARIANT=14-buster
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:dev-${VARIANT}
|
||||
|
||||
# Install tslint, typescript. eslint is installed by javascript image
|
||||
|
@ -4,12 +4,14 @@
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"VARIANT": "12"
|
||||
"VARIANT": "14"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
"extensions": ["dbaeumer.vscode-eslint"],
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
],
|
||||
"remoteUser": "node"
|
||||
}
|
||||
|
6
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
6
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@ -17,7 +17,11 @@ labels:
|
||||
|
||||
## Logs
|
||||
|
||||
<!-- Please provide your deployment logs and a link or sample to/of your workflow. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
||||
<!-- Please provide your deployment logs. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
||||
|
||||
## Workflow
|
||||
|
||||
<!-- Please provide a link or snippet of your workflow yml file. -->
|
||||
|
||||
## Additional Comments
|
||||
|
||||
|
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@ -6,3 +6,10 @@ updates:
|
||||
interval: daily
|
||||
time: '10:00'
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
- package-ecosystem: github-actions
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: daily
|
||||
time: '10:00'
|
||||
open-pull-requests-limit: 10
|
||||
|
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@ -14,9 +14,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -31,7 +31,7 @@ jobs:
|
||||
yarn test
|
||||
|
||||
- name: Uploade CodeCov Report
|
||||
uses: codecov/codecov-action@v1
|
||||
uses: codecov/codecov-action@v2.1.0
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@ -39,9 +39,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -77,11 +77,11 @@ jobs:
|
||||
max-parallel: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
|
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -8,12 +8,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
# 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.0.0
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
branch: releases/v4
|
||||
folder: .
|
||||
|
58
.github/workflows/integration.yml
vendored
58
.github/workflows/integration.yml
vendored
@ -20,10 +20,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
git-config-name: Montezuma
|
||||
git-config-email: montezuma@jamesiv.es
|
||||
@ -44,7 +44,7 @@ jobs:
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
branch: gh-pages
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -66,12 +66,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: integration
|
||||
@ -79,7 +79,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -94,7 +94,7 @@ jobs:
|
||||
LANG: C.UTF-8
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@ -103,7 +103,7 @@ jobs:
|
||||
apt-get update && apt-get install -y rsync
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: integration
|
||||
@ -111,7 +111,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -122,12 +122,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
branch: gh-pages
|
||||
@ -136,7 +136,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -147,17 +147,17 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install SSH Client
|
||||
uses: webfactory/ssh-agent@v0.4.1
|
||||
uses: webfactory/ssh-agent@v0.5.4
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
ssh-key: true
|
||||
branch: gh-pages
|
||||
@ -166,7 +166,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -176,17 +176,17 @@ jobs:
|
||||
needs: integration-ssh-third-party-client
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
branch: gh-pages
|
||||
@ -195,7 +195,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
branch: gh-pages
|
||||
@ -204,7 +204,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: gh-pages
|
||||
@ -218,17 +218,17 @@ jobs:
|
||||
integration-container,
|
||||
integration-ssh,
|
||||
integration-ssh-third-party-client,
|
||||
integration-env
|
||||
integration-env,
|
||||
]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
branch: gh-pages
|
||||
@ -242,12 +242,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
branch: integration-test-delete-prod
|
||||
@ -256,7 +256,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
branch: integration-test-delete-prod
|
||||
@ -266,7 +266,7 @@ jobs:
|
||||
silent: true
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
uses: dawidd6/action-delete-branch@v3.1.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branches: integration-test-delete-prod
|
||||
|
4
.github/workflows/production.yml
vendored
4
.github/workflows/production.yml
vendored
@ -13,9 +13,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
6
.github/workflows/publish.yml
vendored
6
.github/workflows/publish.yml
vendored
@ -10,12 +10,12 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
ref: dev
|
||||
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@ -41,7 +41,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
# Setup .npmrc file to publish to GitHub Packages
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
- uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 'v14.18.1'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
|
6
.github/workflows/sponsors.yml
vendored
6
.github/workflows/sponsors.yml
vendored
@ -9,10 +9,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v2.4.0
|
||||
|
||||
- name: Generate Sponsors 💖
|
||||
uses: JamesIves/github-sponsors-readme-action@releases/v1
|
||||
uses: JamesIves/github-sponsors-readme-action@1.0.6
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
file: 'README.md'
|
||||
@ -20,7 +20,7 @@ jobs:
|
||||
minimum: 500
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.4
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
with:
|
||||
branch: dev
|
||||
folder: '.'
|
||||
|
24
README.md
24
README.md
@ -52,7 +52,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
uses: actions/checkout@v2.5.1
|
||||
|
||||
- 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: |
|
||||
@ -60,7 +60,7 @@ jobs:
|
||||
npm run build
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
with:
|
||||
branch: gh-pages # The branch the action should deploy to.
|
||||
folder: build # The folder the action should deploy.
|
||||
@ -75,7 +75,7 @@ on:
|
||||
- main
|
||||
```
|
||||
|
||||
It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates) 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).
|
||||
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).
|
||||
|
||||
#### Install as a Node Module 📦
|
||||
|
||||
@ -178,7 +178,7 @@ With this configured you can then set the `ssh-key` part of the action to your p
|
||||
|
||||
```yml
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: site
|
||||
@ -199,7 +199,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
uses: actions/checkout@v2.5.1
|
||||
|
||||
- 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: |
|
||||
@ -207,7 +207,7 @@ jobs:
|
||||
npm run build
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: build
|
||||
@ -248,7 +248,7 @@ jobs:
|
||||
runs-on: windows-latest # The first job utilizes windows-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
uses: actions/checkout@v2.5.1
|
||||
|
||||
- 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: |
|
||||
@ -266,7 +266,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
uses: actions/checkout@v2.5.1
|
||||
|
||||
- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
|
||||
uses: actions/download-artifact@v1
|
||||
@ -274,7 +274,7 @@ jobs:
|
||||
name: site
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
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.
|
||||
@ -295,7 +295,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@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
```
|
||||
|
||||
---
|
||||
@ -318,7 +318,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
uses: actions/checkout@v2.5.1
|
||||
|
||||
- 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: |
|
||||
@ -326,7 +326,7 @@ jobs:
|
||||
npm run build
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.9
|
||||
uses: JamesIves/github-pages-deploy-action@4.2.0
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: build
|
||||
|
@ -55,7 +55,7 @@ describe('git', () => {
|
||||
})
|
||||
|
||||
await init(action)
|
||||
expect(execute).toBeCalledTimes(5)
|
||||
expect(execute).toBeCalledTimes(6)
|
||||
})
|
||||
|
||||
it('should catch when a function throws an error', async () => {
|
||||
@ -102,7 +102,7 @@ describe('git', () => {
|
||||
})
|
||||
|
||||
await init(action)
|
||||
expect(execute).toBeCalledTimes(5)
|
||||
expect(execute).toBeCalledTimes(6)
|
||||
})
|
||||
|
||||
it('should not unset git config if a user is using ssh', async () => {
|
||||
@ -124,7 +124,7 @@ describe('git', () => {
|
||||
})
|
||||
|
||||
await init(action)
|
||||
expect(execute).toBeCalledTimes(4)
|
||||
expect(execute).toBeCalledTimes(5)
|
||||
|
||||
process.env.CI = undefined
|
||||
})
|
||||
@ -145,7 +145,7 @@ describe('git', () => {
|
||||
})
|
||||
|
||||
await init(action)
|
||||
expect(execute).toBeCalledTimes(5)
|
||||
expect(execute).toBeCalledTimes(6)
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
process.env['INPUT_FOLDER'] = 'build'
|
||||
process.env['GITHUB_SHA'] = '123'
|
||||
process.env['INPUT_DEBUG'] = 'debug'
|
||||
process.env['GITHUB_REF_NAME'] = 'test'
|
||||
|
||||
import '../src/main'
|
||||
import {action, TestFlag} from '../src/constants'
|
||||
@ -49,7 +50,7 @@ describe('main', () => {
|
||||
debug: true
|
||||
})
|
||||
await run(action)
|
||||
expect(execute).toBeCalledTimes(15)
|
||||
expect(execute).toBeCalledTimes(16)
|
||||
expect(rmRF).toBeCalledTimes(1)
|
||||
expect(exportVariable).toBeCalledTimes(1)
|
||||
})
|
||||
@ -69,7 +70,7 @@ describe('main', () => {
|
||||
isTest: TestFlag.HAS_CHANGED_FILES
|
||||
})
|
||||
await run(action)
|
||||
expect(execute).toBeCalledTimes(18)
|
||||
expect(execute).toBeCalledTimes(19)
|
||||
expect(rmRF).toBeCalledTimes(1)
|
||||
expect(exportVariable).toBeCalledTimes(1)
|
||||
})
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "@jamesives/github-pages-deploy-action",
|
||||
"description": "GitHub action for building a project and deploying it to GitHub pages.",
|
||||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
|
||||
"version": "4.1.8",
|
||||
"version": "4.1.9",
|
||||
"license": "MIT",
|
||||
"main": "lib/lib.js",
|
||||
"types": "lib/lib.d.ts",
|
||||
|
@ -148,3 +148,21 @@ export enum Status {
|
||||
SKIPPED = 'skipped',
|
||||
RUNNING = 'running'
|
||||
}
|
||||
|
||||
/* Platform codes. */
|
||||
export enum OperatingSystems {
|
||||
LINUX = 'Linux',
|
||||
WINDOWS = 'Windows',
|
||||
MACOS = 'macOS'
|
||||
}
|
||||
|
||||
export const SupportedOperatingSystems = [OperatingSystems.LINUX]
|
||||
|
||||
/* Excluded files. */
|
||||
export enum DefaultExcludedFiles {
|
||||
CNAME = 'CNAME',
|
||||
NOJEKYLL = '.nojekyll',
|
||||
SSH = '.ssh',
|
||||
GIT = '.git',
|
||||
GITHUB = '.github'
|
||||
}
|
||||
|
30
src/git.ts
30
src/git.ts
@ -1,7 +1,12 @@
|
||||
import {info} from '@actions/core'
|
||||
import {mkdirP, rmRF} from '@actions/io'
|
||||
import fs from 'fs'
|
||||
import {ActionInterface, Status, TestFlag} from './constants'
|
||||
import {
|
||||
ActionInterface,
|
||||
DefaultExcludedFiles,
|
||||
Status,
|
||||
TestFlag
|
||||
} from './constants'
|
||||
import {execute} from './execute'
|
||||
import {generateWorktree} from './worktree'
|
||||
import {
|
||||
@ -21,12 +26,19 @@ export async function init(action: ActionInterface): Promise<void | Error> {
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
await execute(
|
||||
`git config user.email "${action.email}"`,
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
await execute(
|
||||
`git config core.ignorecase false`,
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
try {
|
||||
if ((process.env.CI && !action.sshKey) || action.isTest) {
|
||||
/* Ensures that previously set Git configs do not interfere with the deployment.
|
||||
@ -129,16 +141,22 @@ export async function deploy(action: ActionInterface): Promise<Status> {
|
||||
} ${
|
||||
action.clean
|
||||
? `--delete ${excludes} ${
|
||||
!fs.existsSync(`${action.folderPath}/CNAME`)
|
||||
? '--exclude CNAME'
|
||||
!fs.existsSync(
|
||||
`${action.folderPath}/${DefaultExcludedFiles.CNAME}`
|
||||
)
|
||||
? `--exclude ${DefaultExcludedFiles.CNAME}`
|
||||
: ''
|
||||
} ${
|
||||
!fs.existsSync(`${action.folderPath}/.nojekyll`)
|
||||
? '--exclude .nojekyll'
|
||||
!fs.existsSync(
|
||||
`${action.folderPath}/${DefaultExcludedFiles.NOJEKYLL}`
|
||||
)
|
||||
? `--exclude ${DefaultExcludedFiles.NOJEKYLL}`
|
||||
: ''
|
||||
}`
|
||||
: ''
|
||||
} --exclude .ssh --exclude .git --exclude .github ${
|
||||
} --exclude ${DefaultExcludedFiles.SSH} --exclude ${
|
||||
DefaultExcludedFiles.GIT
|
||||
} --exclude ${DefaultExcludedFiles.GITHUB} ${
|
||||
action.folderPath === action.workspace
|
||||
? `--exclude ${temporaryDeploymentDirectory}`
|
||||
: ''
|
||||
|
10
src/lib.ts
10
src/lib.ts
@ -23,12 +23,12 @@ export default async function run(
|
||||
info(`
|
||||
GitHub Pages Deploy Action 🚀
|
||||
|
||||
🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
|
||||
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
|
||||
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
|
||||
|
||||
💖 Support: https://github.com/sponsors/JamesIves
|
||||
📣 Maintained by James Ives: https://jamesiv.es
|
||||
💖 Support: https://github.com/sponsors/JamesIves`)
|
||||
|
||||
🚀 Getting Started Guide: https://github.com/JamesIves/github-pages-deploy-action
|
||||
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
|
||||
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues`)
|
||||
|
||||
info('Checking configuration and starting deployment… 🚦')
|
||||
|
||||
|
19
src/util.ts
19
src/util.ts
@ -1,7 +1,12 @@
|
||||
import {isDebug} from '@actions/core'
|
||||
import {isDebug, info} from '@actions/core'
|
||||
import {existsSync} from 'fs'
|
||||
import path from 'path'
|
||||
import {ActionInterface, RequiredActionParameters} from './constants'
|
||||
import {
|
||||
ActionInterface,
|
||||
OperatingSystems,
|
||||
RequiredActionParameters,
|
||||
SupportedOperatingSystems
|
||||
} from './constants'
|
||||
|
||||
/* Replaces all instances of a match in a string. */
|
||||
const replaceAll = (input: string, find: string, replace: string): string =>
|
||||
@ -66,6 +71,16 @@ export const checkParameters = (action: ActionInterface): void => {
|
||||
`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`
|
||||
)
|
||||
}
|
||||
|
||||
if (
|
||||
SupportedOperatingSystems.includes(
|
||||
process.env.RUNNER_OS as OperatingSystems
|
||||
)
|
||||
) {
|
||||
info(
|
||||
`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/* Suppresses sensitive information from being exposed in error messages. */
|
||||
|
@ -43,28 +43,39 @@ export async function generateWorktree(
|
||||
action.workspace,
|
||||
action.silent
|
||||
)
|
||||
|
||||
const checkout = new GitCheckout(action.branch)
|
||||
|
||||
if (branchExists) {
|
||||
// There's existing data on the branch to check out
|
||||
checkout.commitish = `origin/${action.branch}`
|
||||
}
|
||||
if (!branchExists || action.singleCommit) {
|
||||
// Create a new history if we don't have the branch, or if we want to reset it
|
||||
|
||||
if (
|
||||
!branchExists ||
|
||||
(action.singleCommit && action.branch !== process.env.GITHUB_REF_NAME)
|
||||
) {
|
||||
/* Create a new history if we don't have the branch, or if we want to reset it.
|
||||
If the ref name is the same as the branch name, do not attempt to create an orphan of it. */
|
||||
checkout.orphan = true
|
||||
}
|
||||
|
||||
await execute(
|
||||
checkout.toString(),
|
||||
`${action.workspace}/${worktreedir}`,
|
||||
action.silent
|
||||
)
|
||||
|
||||
if (!branchExists) {
|
||||
info(`Created the ${action.branch} branch… 🔧`)
|
||||
|
||||
// Our index is in HEAD state, reset
|
||||
await execute(
|
||||
'git reset --hard',
|
||||
`${action.workspace}/${worktreedir}`,
|
||||
action.silent
|
||||
)
|
||||
|
||||
if (!action.singleCommit) {
|
||||
// New history isn't singleCommit, create empty initial commit
|
||||
await execute(
|
||||
|
Loading…
Reference in New Issue
Block a user