Compare commits

..

4 Commits

Author SHA1 Message Date
peaceiris
25ae83ba65 chore(release): 3.6.0-0
Some checks failed
Release / release (push) Has been cancelled
2020-03-07 06:25:48 +09:00
peaceiris
ce50d1857c chore(release): Add build assets 2020-03-07 06:25:48 +09:00
peaceiris
46146058b6 fix: Use io.cp() on windows 2020-03-07 06:19:48 +09:00
peaceiris
5d8f5a15f7 feat: Use rsync instead of io.cp() 2020-03-06 21:10:16 +00:00
22 changed files with 88 additions and 128 deletions

View File

@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: 'sample_title'
title: 'Bug: This is a sample issue title'
labels: bug
assignees: peaceiris

View File

@@ -3,9 +3,6 @@ contact_links:
- name: GitHub Actions Community Forum
url: https://github.community/t5/GitHub-Actions/bd-p/actions
about: Please ask questions about GitHub Actions here.
- name: GitHub Pages Documentation
- name: GitHub Pages help
url: https://help.github.com/en/github/working-with-github-pages
about: GitHub Pages official documentaion here.
- name: GitHub Actions Documentation
url: https://help.github.com/en/actions
about: GitHub Actions official documentaion here.
about: GitHub Pages documentaion here.

View File

@@ -1,7 +1,7 @@
---
name: Proposal
about: Suggest an idea for this project
title: 'sample_title'
title: 'proposal: This is a sample title'
labels: proposal
assignees: peaceiris

View File

@@ -1,31 +0,0 @@
---
name: User support
about: Questions for this action
title: 'sample_title'
labels: support
assignees: peaceiris
---
**Check list before opening this issue**
- [ ] I read the latest README
- I checked [Available Options](https://github.com/peaceiris/actions-gh-pages#options)
- I followed [Tips and FAQ](https://github.com/peaceiris/actions-gh-pages#tips-and-faq)
- I tried [Workflow Examples](https://github.com/peaceiris/actions-gh-pages#examples)
**Describe your question**
A clear and concise description of what the question is.
**Link to your contents**
- Link to your public repository here
- Link to your workflow here
**Screenshots**
If applicable, add screenshots to help explain your question.
**Additional context**
Add any other context about the problem here.

View File

@@ -3,12 +3,13 @@ name: Release
on:
push:
tags:
- 'v3.*.*'
- 'v3.*.*'
jobs:
release:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Dump GitHub context
@@ -18,8 +19,8 @@ jobs:
- name: Install github/hub
run: |
export HUB_VERSION="2.14.2"
curl -fsSL https://github.com/github/hub/raw/8d91904208171b013f9a9d1175f4ab39068db047/script/get | bash -s "${HUB_VERSION}"
export HUB_VERSION="2.14.1"
curl -fsSL https://github.com/github/hub/raw/40e421edd2c63d57bb8daa4bb9bbdfa21e8becf9/script/get | bash -s "${HUB_VERSION}"
- name: Create release
env:

View File

@@ -87,8 +87,8 @@ jobs:
allow_empty_commit: true
# keep_files: true
# force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
# user_name: iris
# user_email: email@peaceiris.com
# commit_message: ${{ github.event.head_commit.message }}
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'

View File

@@ -2,35 +2,16 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [3.5.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.0...v3.5.1) (2020-03-09)
# [3.6.0-0](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.0...v3.6.0-0) (2020-03-06)
### chore
### feat
* [ImgBot] Optimize images (#147) ([d8ed36f](https://github.com/peaceiris/actions-gh-pages/commit/d8ed36f54aee9f59e2e00fa7aceda885cd6d3eb8)), closes [#147](https://github.com/peaceiris/actions-gh-pages/issues/147)
* Add missing descriptions ([a7bc3c3](https://github.com/peaceiris/actions-gh-pages/commit/a7bc3c37fdc9c640720165cb06fbffe20febe7a3))
* Add user support issue template (#146) ([86214f3](https://github.com/peaceiris/actions-gh-pages/commit/86214f3d7909e3e81e38f0a73a897e00fc1198e4)), closes [#146](https://github.com/peaceiris/actions-gh-pages/issues/146) [#58](https://github.com/peaceiris/actions-gh-pages/issues/58)
* Use rsync instead of io.cp() ([5d8f5a1](https://github.com/peaceiris/actions-gh-pages/commit/5d8f5a15f78784a868a9744f3b343232dbcbd918))
### ci
### fix
* Add GitHub Actions bot as committer ([80c8fe5](https://github.com/peaceiris/actions-gh-pages/commit/80c8fe5fb32cd1e1b866e2d0d0d34cb1ba492586))
* fix user_name ([f3b165f](https://github.com/peaceiris/actions-gh-pages/commit/f3b165fbe1a9ec4c9bd8b435ee13fc7cb10ef42a))
* fix user_name ([945c44d](https://github.com/peaceiris/actions-gh-pages/commit/945c44d50a26eb6b24dbc0157dd836a39f9d5edb))
* update script link [skip ci] ([c279167](https://github.com/peaceiris/actions-gh-pages/commit/c2791671998aa8f7858322a1bb74a1e74fb58923))
### deps
* bump @types/jest from 25.1.3 to 25.1.4 (#148) ([a4c25ca](https://github.com/peaceiris/actions-gh-pages/commit/a4c25ca7788f09428015b84ffd661ec30c7f2734)), closes [#148](https://github.com/peaceiris/actions-gh-pages/issues/148)
* bump hub 2.14.1 to 2.14.2 ([618792b](https://github.com/peaceiris/actions-gh-pages/commit/618792b2f09d6b33bc394ffa2ffaec5ce48fc15d))
### docs
* Add bot committer image ([d2d8e21](https://github.com/peaceiris/actions-gh-pages/commit/d2d8e21d7ee28e4ab68e977f54ce0de33f9ae3ba))
* Add GitHub Actions bot committer ([81884ef](https://github.com/peaceiris/actions-gh-pages/commit/81884efe7cbee81f6d73a96037ac547b3eda1b78))
* Add notes about GitHub_TOKEN (#145) ([6852043](https://github.com/peaceiris/actions-gh-pages/commit/68520436f89fb253238c54f1ad6c5c3681c3e85b)), closes [#145](https://github.com/peaceiris/actions-gh-pages/issues/145)
* fix user_name ([9571d29](https://github.com/peaceiris/actions-gh-pages/commit/9571d29e0df7e4a5bd5700f5531848e9158d7a2c))
* fix user_name ([eb73e9c](https://github.com/peaceiris/actions-gh-pages/commit/eb73e9cb9d8ed1656b67a83c37e7dc1bc9c0dc00))
* fix user_name ([860ed19](https://github.com/peaceiris/actions-gh-pages/commit/860ed1944f8968c2df2e052bd419a015ec10be38))
* Use io.cp() on windows ([4614605](https://github.com/peaceiris/actions-gh-pages/commit/46146058b69b014134a7d788299d643e83cc3176))

View File

@@ -11,6 +11,7 @@ RUN apt-get update && \
ca-certificates \
wget \
ssh \
rsync \
vim && \
rm -rf /var/lib/apt/lists/* && \
npm i -g npm

View File

@@ -42,8 +42,6 @@ Three tokens are supported.
| `deploy_key` | ✅️ | ✅️ | SSH | Necessary |
| `personal_token` | ✅️ | ✅️ | HTTPS | Necessary |
Notes: Actually, the `GitHub_TOKEN` works for deploying to GitHub Pages but it has still some limitations. For the first deployment, we need to select the `gh-pages` branch or `master` branch on the repository settings tab. See [First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
### Supported Platforms
| runs-on | `github_token` | `deploy_key` | `personal_token` |
@@ -79,7 +77,6 @@ Notes: Actually, the `GitHub_TOKEN` works for deploying to GitHub Pages but it h
- [⭐️ Create Git tag](#%EF%B8%8F-create-git-tag)
- [Tips and FAQ](#tips-and-faq)
- [⭐️ Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key)
- [⭐️ First Deployment with `GITHUB_TOKEN`](#%EF%B8%8F-first-deployment-with-github_token)
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
- [Examples](#examples)
- [⭐️ Static Site Generators with Node.js](#%EF%B8%8F-static-site-generators-with-nodejs)
@@ -143,9 +140,13 @@ jobs:
The above example is for [Project Pages sites]. (`<username>/<project_name>` repository)
| Actions log overview | GitHub Pages log |
| Actions log overview | Build step log |
|---|---|
| ![](./images/log_overview.jpg) | ![](./images/log_success.jpg) |
| ![](./images/log1.jpg) | ![](./images/log2.jpg) |
| Deploy step log | GitHub Pages log |
|---|---|
| ![](./images/log3.jpg) | ![](./images/log4.jpg) |
### ⭐️ Repository type - User and Organization
@@ -192,7 +193,7 @@ jobs:
### ⭐️ `deploy_key`
Read [Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key), create your SSH deploy key, and set the `deploy_key` option like the following.
Read [⭐️ Create SSH Deploy Key](#%EF%B8%8F-create-ssh-deploy-key), create your SSH deploy key, and set the `deploy_key` option like the following.
```yaml
- name: Deploy
@@ -327,12 +328,10 @@ A commit is always created with the same user.
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: iris
user_email: iris@peaceiris.com
```
<img width="400px" alt="Add GitHub Actions bot as a committer" src="./images/committer_github_actions_bot.jpg">
### ⭐️ Set custom commit message
Set custom commit message.
@@ -432,18 +431,6 @@ Next, Go to **Repository Settings**
|---|---|
| ![](./images/secrets-1.jpg) | ![](./images/secrets-2.jpg) |
### ⭐️ First Deployment with `GITHUB_TOKEN`
The `GITHUB_TOKEN` has limitations for the first deployment so we have to select the GitHub Pages branch on the repository settings tab.
| First deployment failed | Go to the settings tab |
|---|---|
| ![](./images/log_first_deployment_failed_with_github_token.jpg) | ![](./images/settings_inactive.jpg) |
| Select branch | Deploying again and succeed |
|---|---|
| ![](./images/settings_select.jpg) | ![](./images/log_success.jpg) |
### ⭐️ Use the latest and specific release
We recommend you to use the latest and specific release of this action for stable CI/CD.

View File

@@ -9,24 +9,24 @@ branding:
color: 'blue'
inputs:
deploy_key:
description: 'Set a SSH private key from repository secret value for pushing to the remote branch.'
description: ''
required: false
github_token:
description: 'Set a generated GITHUB_TOKEN for pushing to the remote branch.'
description: ''
required: false
personal_token:
description: 'Set a personal access token for pushing to the remote branch.'
description: ''
required: false
publish_branch:
description: 'Set a target branch for deployment.'
description: ''
required: false
default: 'gh-pages'
publish_dir:
description: 'Set an input directory for deployment.'
description: ''
required: false
default: 'public'
external_repository:
description: 'Set an external repository (owner/repo).'
description: ''
required: false
allow_empty_commit:
description: 'If empty commits should be made to the publication branch'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
images/log2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
images/log3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

View File

@@ -8435,26 +8435,39 @@ exports.createBranchForce = createBranchForce;
function copyAssets(publishDir, workDir) {
var e_1, _a;
return __awaiter(this, void 0, void 0, function* () {
const copyOpts = { recursive: true, force: true };
const files = fs_1.default.readdirSync(publishDir);
core.debug(`${files}`);
try {
for (var files_1 = __asyncValues(files), files_1_1; files_1_1 = yield files_1.next(), !files_1_1.done;) {
const file = files_1_1.value;
if (file.endsWith('.git') || file.endsWith('.github')) {
continue;
if (process.platform === 'win32') {
const copyOpts = { recursive: true, force: true };
const files = fs_1.default.readdirSync(publishDir);
core.debug(`${files}`);
try {
for (var files_1 = __asyncValues(files), files_1_1; files_1_1 = yield files_1.next(), !files_1_1.done;) {
const file = files_1_1.value;
if (file.endsWith('.git') || file.endsWith('.github')) {
continue;
}
const filePath = path_1.default.join(publishDir, file);
yield io.cp(filePath, `${workDir}/`, copyOpts);
core.info(`[INFO] copy ${file}`);
}
const filePath = path_1.default.join(publishDir, file);
yield io.cp(filePath, `${workDir}/`, copyOpts);
core.info(`[INFO] copy ${file}`);
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (files_1_1 && !files_1_1.done && (_a = files_1.return)) yield _a.call(files_1);
}
finally { if (e_1) throw e_1.error; }
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (files_1_1 && !files_1_1.done && (_a = files_1.return)) yield _a.call(files_1);
}
finally { if (e_1) throw e_1.error; }
else {
yield exec.exec('rsync', [
'-rptgoDv',
'--copy-links',
'--copy-dirlinks',
"--exclude='.git'",
"--exclude='.github'",
`${publishDir}/`,
`${workDir}/`
]);
}
return;
});

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.5.1",
"version": "3.6.0-0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -740,9 +740,9 @@
}
},
"@types/jest": {
"version": "25.1.4",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.4.tgz",
"integrity": "sha512-QDDY2uNAhCV7TMCITrxz+MRk1EizcsevzfeS6LykIlq2V1E5oO4wXG8V2ZEd9w7Snxeeagk46YbMgZ8ESHx3sw==",
"version": "25.1.3",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.1.3.tgz",
"integrity": "sha512-jqargqzyJWgWAJCXX96LBGR/Ei7wQcZBvRv0PLEu9ZByMfcs23keUJrKv9FMR6YZf9YCbfqDqgmY+JUBsnqhrg==",
"dev": true,
"requires": {
"jest-diff": "^25.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.5.1",
"version": "3.6.0-0",
"description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js",
"engines": {
@@ -56,7 +56,7 @@
"@actions/io": "^1.0.2"
},
"devDependencies": {
"@types/jest": "^25.1.4",
"@types/jest": "^25.1.3",
"@types/js-yaml": "^3.12.2",
"@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.22.0",

View File

@@ -17,18 +17,29 @@ export async function copyAssets(
publishDir: string,
workDir: string
): Promise<void> {
const copyOpts = {recursive: true, force: true};
const files = fs.readdirSync(publishDir);
core.debug(`${files}`);
for await (const file of files) {
if (file.endsWith('.git') || file.endsWith('.github')) {
continue;
if (process.platform === 'win32') {
const copyOpts = {recursive: true, force: true};
const files = fs.readdirSync(publishDir);
core.debug(`${files}`);
for await (const file of files) {
if (file.endsWith('.git') || file.endsWith('.github')) {
continue;
}
const filePath = path.join(publishDir, file);
await io.cp(filePath, `${workDir}/`, copyOpts);
core.info(`[INFO] copy ${file}`);
}
const filePath = path.join(publishDir, file);
await io.cp(filePath, `${workDir}/`, copyOpts);
core.info(`[INFO] copy ${file}`);
} else {
await exec.exec('rsync', [
'-rptgoDv',
'--copy-links',
'--copy-dirlinks',
"--exclude='.git'",
"--exclude='.github'",
`${publishDir}/`,
`${workDir}/`
]);
}
return;
}