actions-gh-pages

GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.

MIT License

Downloads
1
Stars
4.7K
Committers
39

Bot releases are visible (Hide)

actions-gh-pages - Release v2.10.2-0

Published by peaceiris over 4 years ago

Pre-release v2.10.2-0 for #82

actions-gh-pages - Release v2.10.1

Published by peaceiris over 4 years ago

deps: bump alpine from 3.11.2 to 3.11.3

actions-gh-pages - Release v2.10.0

Published by peaceiris almost 5 years ago

New Feature

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.

actions-gh-pages - Pre-release v2.10.0-1

Published by peaceiris almost 5 years ago

Pre-release v2.10.0-1 for #78

actions-gh-pages - Pre-release v2.10.0-0

Published by peaceiris almost 5 years ago

Pre-release v2.10.0-0 for #78

actions-gh-pages - GitHub Pages Action v2.9.0

Published by peaceiris almost 5 years ago

Release v2.9.0

New Feature

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

Fixes

Add a linkable commit hash for external repository deployment. #73

Mentioned by @fabiosangregorio #72

actions-gh-pages - GitHub Pages Action v2.9.0-0

Published by peaceiris almost 5 years ago

Pre-release for #75

actions-gh-pages - GitHub Pages Action v2.8.1-0

Published by peaceiris almost 5 years ago

Pre-release for #73

actions-gh-pages - GitHub Pages Action v2.8.0

Published by peaceiris almost 5 years ago

Release v2.8.0

New Feature

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]"

cf. Comparing v2.7.0...v2.8.0 · peaceiris/actions-gh-pages

actions-gh-pages - GitHub Pages Action v2.7.0

Published by peaceiris almost 5 years ago

Release v2.7.0

  • feat: Ignore .git and .github #63
  • feat: Bumps alpine from 3.10.3 to 3.11.0 #63

cf. Comparing v2.6.0...v2.7.0 · peaceiris/actions-gh-pages

actions-gh-pages - Pre-release v2.8.0-0

Published by peaceiris almost 5 years ago

Pre-release v2.8.0-0 of #67

actions-gh-pages - GitHub Actions for GitHub Pages Pre-release v2.7.0-1

Published by peaceiris almost 5 years ago

Pre-release v2.7.0-1 for #63 and #64

actions-gh-pages - GitHub Actions for GitHub Pages v2.7.0-0

Published by peaceiris almost 5 years ago

Release v2.7.0-0 for #63

actions-gh-pages - GitHub Actions for GitHub Pages v2.6.0

Published by peaceiris almost 5 years ago

Release v2.6.0

New Feature

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

cf. Comparing v2.5.1...v2.6.0 · peaceiris/actions-gh-pages

actions-gh-pages - v2.5.1

Published by peaceiris almost 5 years ago

actions-gh-pages - v2.6.0-rc0

Published by peaceiris about 5 years ago

Pre-release for Pull Request #43

actions-gh-pages - v2.5.0

Published by peaceiris about 5 years ago

New options

Deploy to external repository

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

Script mode

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

actions-gh-pages - v2.5.0-rc2

Published by peaceiris about 5 years ago

Test for #38

actions-gh-pages - v2.5.0-rc1

Published by peaceiris about 5 years ago

v2.5.0-rc1 #38

actions-gh-pages - v2.5.0-rc0

Published by peaceiris about 5 years ago

v2.5.0-rc0 for #36

Package Rankings
Top 19.42% on Npmjs.org
Top 0.08% on Github actions
Top 9.63% on Proxy.golang.org
Badges
Extracted from project README
license release GitHub release date CodeFactor peaceiris/actions-hugo - GitHub