Compare commits

...

19 Commits

Author SHA1 Message Date
peaceiris
1029512144 chore(release): 3.7.0-3
Some checks failed
Release / release (push) Has been cancelled
2020-07-24 21:33:53 +09:00
peaceiris
6c430d988e chore(release): Add build assets 2020-07-24 21:33:51 +09:00
Shohei Ueda
6f6bb2661a fix: set full path of publishing assets (#413)
https://github.com/peaceiris/actions-gh-pages/issues/410#issuecomment-663507581
2020-07-24 21:33:08 +09:00
dependabot[bot]
d1700b5653 deps: bump @types/jest from 26.0.5 to 26.0.7 (#411)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.5 to 26.0.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-24 11:37:53 +09:00
dependabot[bot]
1b5d710b24 deps: bump @types/node from 12.12.51 to 12.12.52 (#412)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.51 to 12.12.52.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-24 11:37:39 +09:00
peaceiris
3667febec5 refactor: change message type from warning to info 2020-07-24 00:49:02 +09:00
peaceiris
8546b0c56b chore(release): Remove build assets [skip ci] 2020-07-24 00:42:18 +09:00
peaceiris
2c04f23922 chore(release): 3.7.0-2
Some checks failed
Release / release (push) Has been cancelled
2020-07-24 00:42:17 +09:00
peaceiris
b15488f0b3 chore(release): Add build assets 2020-07-24 00:42:15 +09:00
peaceiris
612f1f7579 fix: chdir to workDir after copied assets
Related to #324
2020-07-24 00:40:01 +09:00
dependabot[bot]
af7aac1007 ci: bump codecov/codecov-action from v1.0.11 to v1.0.12 (#409)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from v1.0.11 to v1.0.12.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Commits](https://github.com/codecov/codecov-action/compare/v1.0.11...07127fde53bc3ccd346d47ab2f14c390161ad108)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-23 14:28:01 +09:00
peaceiris
6896bd8b80 docs: change default-branch to main 2020-07-23 12:17:19 +09:00
Shohei Ueda
ad558aa8bd docs: bump hugo from 0.71.1 to 0.74.2 2020-07-23 12:12:27 +09:00
Shohei Ueda
5051105279 docs: change master branch to default-branch (#408) 2020-07-23 12:10:40 +09:00
Shohei Ueda
99a89f661a docs: Add Code Scanning workflow badge 2020-07-23 11:22:23 +09:00
dependabot[bot]
8cd820bd66 ci: bump actions/setup-node from v2.1.0 to v2.1.1 (#407)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.0 to v2.1.1.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.0...321b6ccb03083caa2ad22b27dc4b45335212e824)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-22 14:42:08 +09:00
Shohei Ueda
f633b0f6b5 ci: remove types [skip ci] 2020-07-21 19:44:14 +09:00
Shohei Ueda
a2712f7b92 ci: Add docker-compose.yml (#406) 2020-07-21 19:37:23 +09:00
peaceiris
09b03c0bb1 chore(release): Remove build assets [skip ci] 2020-07-21 12:53:50 +09:00
11 changed files with 105 additions and 71 deletions

View File

@@ -10,16 +10,15 @@ on:
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'
- 'docker-compose.yml'
pull_request:
types:
- opened
- synchronize
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'
- 'docker-compose.yml'
jobs:
skipci:
@@ -34,10 +33,10 @@ jobs:
- uses: actions/checkout@v2.3.1
- name: Login to Packages
run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login 'docker.pkg.github.com' -u 'peaceiris' --password-stdin
- run: make pull
- run: docker-compose pull --quiet
if: github.event_name == 'pull_request'
- run: make build
- run: make cirun cmd="npm ci"
- run: make ciall
- run: make push
- run: make ci
- run: make all
- run: docker-compose push
if: github.ref == 'refs/heads/main'

View File

@@ -34,7 +34,7 @@ jobs:
id: nvm
- name: Setup Node
uses: actions/setup-node@v2.1.0
uses: actions/setup-node@v2.1.1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
@@ -64,7 +64,7 @@ jobs:
name: coverage-${{ matrix.os }}
path: coverage
- uses: codecov/codecov-action@v1.0.11
- uses: codecov/codecov-action@v1.0.12
with:
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -2,6 +2,47 @@
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.7.0-3](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-2...v3.7.0-3) (2020-07-24)
### deps
* bump @types/jest from 26.0.5 to 26.0.7 (#411) ([d1700b5](https://github.com/peaceiris/actions-gh-pages/commit/d1700b565361478232daa6d66d3fe7c146b9d08f)), closes [#411](https://github.com/peaceiris/actions-gh-pages/issues/411)
* bump @types/node from 12.12.51 to 12.12.52 (#412) ([1b5d710](https://github.com/peaceiris/actions-gh-pages/commit/1b5d710b249d09c1e229931378217c47773de8ed)), closes [#412](https://github.com/peaceiris/actions-gh-pages/issues/412)
### fix
* set full path of publishing assets (#413) ([6f6bb26](https://github.com/peaceiris/actions-gh-pages/commit/6f6bb2661a12d5db5d7df62962d1d28403a02860)), closes [#413](https://github.com/peaceiris/actions-gh-pages/issues/413) [/github.com/peaceiris/actions-gh-pages/issues/410#issuecomment-663507581](https://github.com//github.com/peaceiris/actions-gh-pages/issues/410/issues/issuecomment-663507581)
### refactor
* change message type from warning to info ([3667feb](https://github.com/peaceiris/actions-gh-pages/commit/3667febec573a36efa26505b6a712b314242991a))
# [3.7.0-2](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-1...v3.7.0-2) (2020-07-23)
### ci
* Add docker-compose.yml (#406) ([a2712f7](https://github.com/peaceiris/actions-gh-pages/commit/a2712f7b923e3e05d0f46e54fbcacef3380aca31)), closes [#406](https://github.com/peaceiris/actions-gh-pages/issues/406)
* bump actions/setup-node from v2.1.0 to v2.1.1 (#407) ([8cd820b](https://github.com/peaceiris/actions-gh-pages/commit/8cd820bd660be6aa016923b6b35005df2fb071da)), closes [#407](https://github.com/peaceiris/actions-gh-pages/issues/407)
* bump codecov/codecov-action from v1.0.11 to v1.0.12 (#409) ([af7aac1](https://github.com/peaceiris/actions-gh-pages/commit/af7aac10073791e2907990204f723d6b0ff902c5)), closes [#409](https://github.com/peaceiris/actions-gh-pages/issues/409)
* remove types [skip ci] ([f633b0f](https://github.com/peaceiris/actions-gh-pages/commit/f633b0f6b54f252348cc3b10713b111caaf6f3d1))
### docs
* Add Code Scanning workflow badge ([99a89f6](https://github.com/peaceiris/actions-gh-pages/commit/99a89f661a291c444965018bf828995e08d7bb7b))
* bump hugo from 0.71.1 to 0.74.2 ([ad558aa](https://github.com/peaceiris/actions-gh-pages/commit/ad558aa8bd9ad82edc7bd886159659328e6d61de))
* change default-branch to main ([6896bd8](https://github.com/peaceiris/actions-gh-pages/commit/6896bd8b80ecc02e6c47bbcf7fc1ae0bd4d47645))
* change master branch to default-branch (#408) ([5051105](https://github.com/peaceiris/actions-gh-pages/commit/505110527986e8c3d30694488f643d6529d0d593)), closes [#408](https://github.com/peaceiris/actions-gh-pages/issues/408)
### fix
* chdir to workDir after copied assets ([612f1f7](https://github.com/peaceiris/actions-gh-pages/commit/612f1f7579820dc380d265d61924f7a7d8718859)), closes [#324](https://github.com/peaceiris/actions-gh-pages/issues/324)
# [3.7.0-1](https://github.com/peaceiris/actions-gh-pages/compare/v3.7.0-0...v3.7.0-1) (2020-07-21)

View File

@@ -1,46 +1,22 @@
cmd := "bash"
msg := ""
IMAGE_NAME := docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest
NODE_VERSION := $(shell cat ./.nvmrc)
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)
.PHONY: build
build:
docker build . \
--build-arg NODE_VERSION=$(NODE_VERSION) \
--cache-from=${IMAGE_NAME} \
-t $(IMAGE_NAME)
.PHONY: pull
pull:
docker pull ${IMAGE_NAME}
.PHONY: push
push:
docker push ${IMAGE_NAME}
docker-compose build --build-arg NODE_VERSION=$(NODE_VERSION)
.PHONY: run
run:
$(DOCKER_RUN) $(cmd)
docker-compose run --rm dev bash
.PHONY: cirun
cirun:
$(DOCKER_RUN_CI) $(cmd)
.PHONY: ci
ci:
docker-compose run --rm -T dev npm ci
.PHONY: test
test:
$(DOCKER_RUN) npm test
.PHONY: commit
commit:
$(DOCKER_RUN) git commit -m "$(msg)"
docker-compose run --rm -T dev npm test
.PHONY: all
all:
$(DOCKER_RUN) npm run all
.PHONY: ciall
ciall:
$(DOCKER_RUN_CI) npm run all
docker-compose run --rm -T dev npm run all

View File

@@ -2,6 +2,7 @@
[![release](https://img.shields.io/github/release/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases/latest)
[![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-gh-pages.svg)](https://github.com/peaceiris/actions-gh-pages/releases)
![Test](https://github.com/peaceiris/actions-gh-pages/workflows/Test/badge.svg?branch=main&event=push)
![Code Scanning](https://github.com/peaceiris/actions-gh-pages/workflows/Code%20Scanning/badge.svg?event=push)
[![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-gh-pages)
<img width="400" alt="GitHub Actions for deploying to GitHub Pages with Static Site Generators" src="./images/ogp.svg">
@@ -112,7 +113,7 @@ All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
### ⭐️ Repository type - Project
Add your workflow file `.github/workflows/gh-pages.yml` and push to the remote master branch.
Add your workflow file `.github/workflows/gh-pages.yml` and push to the remote default branch branch.
An example workflow for Hugo.
@@ -126,7 +127,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -140,7 +141,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.71.1'
hugo-version: '0.74.2'
- name: Build
run: hugo --minify
@@ -445,7 +446,7 @@ name: github pages
on:
push:
branches:
- master
- main
tags:
- 'v*.*.*'
@@ -477,7 +478,7 @@ jobs:
Commands on a local machine.
```console
$ # On the master branch
$ # On a main branch
$ git tag -a "v1.2.3" -m "Release v1.2.3"
$ git push origin "v1.2.3"
@@ -485,7 +486,7 @@ $ # After deployment
$ git fetch origin
$ git tag
deploy-v1.2.3 # Tag on the gh-pages branch
v1.2.3 # Tag on the master branch
v1.2.3 # Tag on the main branch
```
<div align="right">
@@ -571,7 +572,7 @@ name: github pages
on:
push:
branches:
- master
- main
schedule:
- cron: "22 22 * * *"
workflow_dispatch:
@@ -608,7 +609,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -652,7 +653,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -700,7 +701,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -751,7 +752,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -797,7 +798,7 @@ name: github pages
on:
push:
branches:
- master
- main
paths:
- '.github/workflows/deploy.yml'
- 'website/**'
@@ -854,7 +855,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -910,7 +911,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -945,7 +946,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -985,7 +986,7 @@ name: github pages
on:
push:
branches:
- master
- main
jobs:
deploy:
@@ -1061,7 +1062,7 @@ name: GitHub Pages
on:
push:
branches:
- master
- main
jobs:
deploy:

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: '3.2'
services:
dev:
image: 'docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest'
build:
context: .
cache_from:
- 'docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest'
container_name: peaceiris_actions_github_pages
volumes:
- ${PWD}:/repo
stdin_open: true
tty: true
command:
- bash

File diff suppressed because one or more lines are too long

14
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.7.0-1",
"version": "3.7.0-3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -997,9 +997,9 @@
}
},
"@types/jest": {
"version": "26.0.5",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.5.tgz",
"integrity": "sha512-heU+7w8snfwfjtcj2H458aTx3m5unIToOJhx75ebHilBiiQ39OIdA18WkG4LP08YKeAoWAGvWg8s+22w/PeJ6w==",
"version": "26.0.7",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.7.tgz",
"integrity": "sha512-+x0077/LoN6MjqBcVOe1y9dpryWnfDZ+Xfo3EqGeBcfPRJlQp3Lw62RvNlWxuGv7kOEwlHriAa54updi3Jvvwg==",
"dev": true,
"requires": {
"jest-diff": "^25.2.1",
@@ -1025,9 +1025,9 @@
"dev": true
},
"@types/node": {
"version": "12.12.51",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.51.tgz",
"integrity": "sha512-6ILqt8iNThALrxDv2Q4LyYFQxULQz96HKNIFd4s9QRQaiHINYeUpLqeU/2IU7YMtvipG1fQVAy//vY8/fX1Y9w=="
"version": "12.12.52",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.52.tgz",
"integrity": "sha512-oNJSI5bzuAH4f4I5JatPf4jytM6vQPWMw8JDOH68mNMyOmSqBkctHBfsyaBU3Su+dhYd8E+tDtPJWUXsyO5Msg=="
},
"@types/normalize-package-data": {
"version": "2.4.0",

View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.7.0-1",
"version": "3.7.0-3",
"description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js",
"engines": {
@@ -60,7 +60,7 @@
"@actions/io": "^1.0.2"
},
"devDependencies": {
"@types/jest": "^26.0.5",
"@types/jest": "^26.0.7",
"@types/js-yaml": "^3.12.4",
"@types/node": "~12",
"@typescript-eslint/eslint-plugin": "^2.34.0",

View File

@@ -20,8 +20,9 @@ export async function copyAssets(publishDir: string, destDir: string): Promise<v
if (file.endsWith('.git') || file.endsWith('.github')) {
continue;
}
const filePath = path.join(publishDir, file);
await io.cp(filePath, `${destDir}/`, copyOpts);
const filePublishPath = path.join(publishDir, file);
const fileDestPath = path.join(destDir, file);
await io.cp(filePublishPath, fileDestPath, copyOpts);
core.info(`[INFO] copy ${file}`);
}
@@ -49,7 +50,6 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
await createDir(destDir);
process.chdir(workDir);
await createBranchForce(inps.PublishBranch);
process.chdir(destDir);
await copyAssets(publishDir, destDir);
return;
}
@@ -93,6 +93,7 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
}
await copyAssets(publishDir, destDir);
process.chdir(workDir);
return;
} else {
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);

View File

@@ -53,7 +53,7 @@ export async function addCNAME(workDir: string, content: string): Promise<void>
}
const filepath = path.join(workDir, 'CNAME');
if (fs.existsSync(filepath)) {
core.warning(`CNAME already exists, skip adding CNAME`);
core.info(`CNAME already exists, skip adding CNAME`);
return;
}
fs.writeFileSync(filepath, content + '\n');