GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.
MIT License
Bot releases are visible (Hide)
Published by peaceiris over 4 years ago
Pre-release v2.10.2-0 for #82
Published by peaceiris over 4 years ago
deps: bump alpine from 3.11.2 to 3.11.3
Published by peaceiris almost 5 years ago
New options tagName
, tagMessage
, and tagOverwrite
.
Suggested by @cinderblock #76 #78
Here is an example workflow.
name: github pages
on:
push:
branches:
- master
tags:
- 'v*.*.*'
jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Some build
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}"
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
- name: Deploy
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with:
tagName: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
tagMessage: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
Commands on a local machine.
$ # On the master branch
$ git tag -a "v1.2.3" -m "Release v1.2.3"
$ git push origin "v1.2.3"
$ # 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
We can set tagOverwrite
option to true
for overwriting a tag.
Published by peaceiris almost 5 years ago
Pre-release v2.10.0-1 for #78
Published by peaceiris almost 5 years ago
Pre-release v2.10.0-0 for #78
Published by peaceiris almost 5 years ago
Release v2.9.0
Custom commit message option #75
When we create a commit with a message docs: Update some post
, a deployment commit will be generated with a message docs: Update some post ${GITHUB_SHA}
.
- name: Deploy
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with:
commitMessage: ${{ github.event.head_commit.message }}
Suggested by @fabiosangregorio #72 #73 #74
Add a linkable commit hash for external repository deployment. #73
Mentioned by @fabiosangregorio #72
Published by peaceiris almost 5 years ago
Pre-release for #75
Published by peaceiris almost 5 years ago
Pre-release for #73
Published by peaceiris almost 5 years ago
Release v2.8.0
Custom Git username and email #67
Set custom git config user.name
and git config user.email
.
A commit is always created with the same user.
- name: Deploy
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with:
username: "iris"
useremail: "[email protected]"
Published by peaceiris almost 5 years ago
Release v2.7.0
.git
and .github
#63Published by peaceiris almost 5 years ago
Pre-release v2.8.0-0 of #67
Published by peaceiris almost 5 years ago
Pre-release v2.7.0-1 for #63 and #64
Published by peaceiris almost 5 years ago
Release v2.7.0-0 for #63
Published by peaceiris almost 5 years ago
Release v2.6.0
Force orphan option
From v2.6.0
, we can set the forceOrphan: true
option.
This allows you to make your publish branch with only the latest commit.
- name: Deploy
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
with:
forceOrphan: true
Published by peaceiris almost 5 years ago
Project settings update
Published by peaceiris about 5 years ago
Pre-release for Pull Request #43
Published by peaceiris about 5 years ago
By default, your files are published to the repository which is running this action. If you want to publish to another repository on GitHub, set the environment variable EXTERNAL_REPOSITORY
to <username>/<external-repository>
. This option is available from v2.5.0
.
For example:
- name: Deploy
uses: peaceiris/[email protected]
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
EXTERNAL_REPOSITORY: username/external-repository
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
You can use ACTIONS_DEPLOY_KEY
or PERSONAL_TOKEN
. When you use ACTIONS_DEPLOY_KEY
, set your private key to the repository which includes this action and set your public key to your external repository.
Be careful, GITHUB_TOKEN
has no permission to access to external repositories.
Implemented by @skyfrk #36
From v2.5.0
, we can run this action as a shell script. There is no Docker build or pull step, so it will start immediately.
ACTIONS_DEPLOY_KEY
requires SCRIPT_MODE: true
*_TOKEN
do not require SCRIPT_MODE
- name: Deploy
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
SCRIPT_MODE: true
run: |
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh
bash ./entrypoint.sh
Implemented by @peaceiris #38
Published by peaceiris about 5 years ago
Test for #38
Published by peaceiris about 5 years ago
v2.5.0-rc1 #38
Published by peaceiris about 5 years ago
v2.5.0-rc0 for #36