Skip to content

Commit

Permalink
Merge branch 'fix-issue-1' (fix #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 13, 2019
2 parents 505be0a + 0c39404 commit 818163f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/benchmarkjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
- name: Run benchmark
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt
- name: Fetch gh-pages for avoiding conflict
run: git fetch 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
run: git fetch 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Benchmark.js Benchmark
tool: 'benchmarkjs'
output-file-path: examples/benchmarkjs/output.txt
- name: Push benchmark result
run: git push 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
# Use personal access token instead of GITHUB_TOKEN due to https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
run: git push 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
5 changes: 3 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt
- name: Fetch gh-pages for avoiding conflict
run: git fetch 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
run: git fetch 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Go Benchmark
tool: 'go'
output-file-path: examples/go/output.txt
- name: Push benchmark result
run: git push 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
# Use personal access token instead of GITHUB_TOKEN due to https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
run: git push 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
5 changes: 3 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
- name: Run benchmark
run: cd examples/rust && cargo +nightly bench | tee output.txt
- name: Fetch gh-pages for avoiding conflict
run: git fetch 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
run: git fetch 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Rust Benchmark
tool: 'cargo'
output-file-path: examples/rust/output.txt
- name: Push benchmark result
run: git push 'https://rhysd:${{ secrets.GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
# Use personal access token instead of GITHUB_TOKEN due to https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
run: git push 'https://rhysd:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/rhysd/github-action-benchmark.git' gh-pages:gh-pages
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,29 @@ branch. Please make it on your remote repository in advance.

Then push the branch to your remote.

As of now, [deploying GitHub Pages branch fails with `$GITHUB_TOKEN` automatically generated for workflows](https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869).
`$GITHUB_TOKEN` can push branch to remote, but building GitHub Pages fails. Please read [issue #1](https://github.com/rhysd/github-action-benchmark/issues/1)
for more details.

To avoid this issue for now, you need to create your personal access token.

1. Go to your user settings page
2. Enter 'Developer settings' tab
3. Enter 'Personal access tokens' tab
4. Click 'Generate new token' and enter your favorite token name
5. Check `public_repo` scope for `git push` and click 'Generate token' at bottom
6. Go to your repository settings page
7. Enter 'Secrets' tab
8. Create new `PERSONAL_GITHUB_TOKEN` secret with generated token string

In the future, this issue would be resolved and we could simply use `$GITHUB_TOKEN` to deploy GitHub
Pages branch. Let's back to workflow YAML file.

e.g.

```yaml
- name: Push benchmark result
run: git push 'https://you:${{ secrets.GITHUB_TOKEN }}@github.com/you/repo-name.git' gh-pages:gh-pages
run: git push 'https://you:${{ secrets.PERSONAL_GITHUB_TOKEN }}@github.com/you/repo-name.git' gh-pages:gh-pages
```

This action does not push changes to remote automatically due to security reason. Action does not know
Expand Down

0 comments on commit 818163f

Please sign in to comment.