Compare commits
5 Commits
v2.10.1
...
v2.6.0-rc0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6a9b4b75a | ||
|
|
a0131c39a3 | ||
|
|
a899cb542b | ||
|
|
f83fbff9f3 | ||
|
|
7216888f95 |
@@ -1,10 +0,0 @@
|
|||||||
version: 1
|
|
||||||
update_configs:
|
|
||||||
- package_manager: "docker"
|
|
||||||
directory: "/"
|
|
||||||
update_schedule: "weekly"
|
|
||||||
default_labels:
|
|
||||||
- "dependencies"
|
|
||||||
- "docker"
|
|
||||||
commit_message:
|
|
||||||
prefix: "deps"
|
|
||||||
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
@@ -1,3 +0,0 @@
|
|||||||
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
|
|
||||||
|
|
||||||
* @peaceiris
|
|
||||||
9
.github/FUNDING.yml
vendored
Normal file
9
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
# github: peaceiris
|
||||||
|
patreon: peaceiris
|
||||||
|
issuehunt: peaceiris
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
custom: # Replace with a single custom sponsorship URL
|
||||||
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: 'Bug: This is a sample issue title'
|
|
||||||
labels: bug
|
|
||||||
assignees: peaceiris
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Your YAML file**
|
|
||||||
- A link to your repository
|
|
||||||
- A link to your YAML file
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
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 help
|
|
||||||
url: https://help.github.com/en/github/working-with-github-pages
|
|
||||||
about: GitHub Pages documentaion here.
|
|
||||||
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
20
.github/ISSUE_TEMPLATE/proposal.md
vendored
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Proposal
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: 'proposal: This is a sample title'
|
|
||||||
labels: proposal
|
|
||||||
assignees: peaceiris
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
28
.github/workflows/docker-image-ci.yml
vendored
28
.github/workflows/docker-image-ci.yml
vendored
@@ -3,11 +3,7 @@ name: docker image ci
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
push:
|
push:
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
@@ -16,25 +12,33 @@ jobs:
|
|||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
DOCKER_IMAGE: docker.pkg.github.com/${{ github.repository }}/action:latest
|
||||||
run: |
|
run: |
|
||||||
docker build . --file Dockerfile --tag ${DOCKER_IMAGE}
|
docker build . --file Dockerfile --tag ${DOCKER_IMAGE} ||
|
||||||
|
(echo -e "\e[31m[${GITHUB_WORKFLOW}] failed to build\e[m" && exit 1)
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@master
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
run: shellcheck ./entrypoint.sh
|
run: shellcheck ./entrypoint.sh
|
||||||
|
|
||||||
hadolint:
|
hadolint:
|
||||||
runs-on: macos-latest
|
runs-on: macOS-10.14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@master
|
||||||
- run: brew install hadolint
|
with:
|
||||||
- run: hadolint ./Dockerfile
|
fetch-depth: 1
|
||||||
|
- name: hadolint
|
||||||
|
run: |
|
||||||
|
brew install hadolint
|
||||||
|
hadolint ./Dockerfile
|
||||||
|
|||||||
16
.github/workflows/purge-readme-image-cache.yml
vendored
16
.github/workflows/purge-readme-image-cache.yml
vendored
@@ -1,16 +0,0 @@
|
|||||||
name: Purge image cache
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '54 18 * * */7'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
purge:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- run: >
|
|
||||||
curl -sL https://github.com/${GITHUB_REPOSITORY} |
|
|
||||||
grep -oE '<img src="https?://camo.githubusercontent.com/[^"]+' |
|
|
||||||
sed -e 's/<img src="//' |
|
|
||||||
xargs -I % curl -sX PURGE %
|
|
||||||
17
.github/workflows/stale.yml
vendored
17
.github/workflows/stale.yml
vendored
@@ -1,17 +0,0 @@
|
|||||||
name: "Stale"
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "6 6 * * *"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/stale@v1
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
|
||||||
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
|
||||||
days-before-stale: 21
|
|
||||||
days-before-close: 7
|
|
||||||
24
.github/workflows/update-major-tag.yml
vendored
24
.github/workflows/update-major-tag.yml
vendored
@@ -1,24 +0,0 @@
|
|||||||
name: Update major tag
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Update major tag
|
|
||||||
if: github.event.release.prerelease == false
|
|
||||||
run: |
|
|
||||||
git config user.name "${GITHUB_ACTOR}"
|
|
||||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
|
||||||
export TAG_NAME="${GITHUB_REF##refs/tags/}"
|
|
||||||
export TAG_MAJOR="${TAG_NAME%%.*}"
|
|
||||||
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || git tag -d "${TAG_MAJOR}" ; git push --delete origin "${TAG_MAJOR}"
|
|
||||||
git tag "${TAG_MAJOR}" -m "Release ${TAG_NAME}" || true
|
|
||||||
git push origin "${TAG_MAJOR}"
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.11.3
|
FROM alpine:3.10.2
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Shohei Ueda (peaceiris)
|
Copyright (c) 2019 Shohei Ueda (peaceiris)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
416
README.md
416
README.md
@@ -11,45 +11,21 @@
|
|||||||
## GitHub Actions for GitHub Pages
|
## GitHub Actions for GitHub Pages
|
||||||
|
|
||||||
This is a **GitHub Action** to deploy your static files to **GitHub Pages**.
|
This is a **GitHub Action** to deploy your static files to **GitHub Pages**.
|
||||||
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, GitBook, mdBook, etc.)
|
This deploy action can be combined simply and freely with [Static Site Generators]. (Hugo, MkDocs, Gatsby, GitBook, etc.)
|
||||||
|
|
||||||
[Static Site Generators]: https://www.staticgen.com/
|
[Static Site Generators]: https://www.staticgen.com/
|
||||||
|
|
||||||
The next example step will deploy `./public` directory to the remote `gh-pages` branch.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
||||||
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
|
|
||||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
PUBLISH_BRANCH: gh-pages
|
|
||||||
PUBLISH_DIR: ./public
|
|
||||||
```
|
|
||||||
|
|
||||||
Three tokens are supported.
|
|
||||||
|
|
||||||
| Token | Private repo | Public repo | Protocol | Setup |
|
|
||||||
|---|:---:|:---:|---|---|
|
|
||||||
| `GITHUB_TOKEN` | ✅️ | ❌️ | HTTPS | Unnecessary |
|
|
||||||
| `PERSONAL_TOKEN` | ✅️ | ✅️ | HTTPS | Necessary |
|
|
||||||
| `ACTIONS_DEPLOY_KEY` | ✅️ | ✅️ | SSH | Necessary |
|
|
||||||
|
|
||||||
Do you want to skip the docker build step? OK, the script mode is available.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
PUBLISH_DIR: ./public
|
PUBLISH_DIR: ./public
|
||||||
SCRIPT_MODE: true
|
|
||||||
run: |
|
|
||||||
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
|
|
||||||
bash ./entrypoint.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The above example step will deploy `./public` directory to `gh-pages` branch.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
@@ -70,10 +46,6 @@ Do you want to skip the docker build step? OK, the script mode is available.
|
|||||||
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
|
- [⭐️ Suppressing empty commits](#%EF%B8%8F-suppressing-empty-commits)
|
||||||
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
- [⭐️ Keeping existing files](#%EF%B8%8F-keeping-existing-files)
|
||||||
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
- [⭐️ Deploy to external repository](#%EF%B8%8F-deploy-to-external-repository)
|
||||||
- [⭐️ Force orphan](#%EF%B8%8F-force-orphan)
|
|
||||||
- [⭐️ Set Git username and email](#%EF%B8%8F-set-git-username-and-email)
|
|
||||||
- [⭐️ Set custom commit message](#%EF%B8%8F-set-custom-commit-message)
|
|
||||||
- [⭐️ Create Git tag](#%EF%B8%8F-create-git-tag)
|
|
||||||
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
- [⭐️ Script mode](#%EF%B8%8F-script-mode)
|
||||||
- [Tips and FAQ](#tips-and-faq)
|
- [Tips and FAQ](#tips-and-faq)
|
||||||
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
- [⭐️ Use the latest and specific release](#%EF%B8%8F-use-the-latest-and-specific-release)
|
||||||
@@ -85,9 +57,6 @@ Do you want to skip the docker build step? OK, the script mode is available.
|
|||||||
- [⭐️ React and Next](#%EF%B8%8F-react-and-next)
|
- [⭐️ React and Next](#%EF%B8%8F-react-and-next)
|
||||||
- [⭐️ Vue and Nuxt](#%EF%B8%8F-vue-and-nuxt)
|
- [⭐️ Vue and Nuxt](#%EF%B8%8F-vue-and-nuxt)
|
||||||
- [⭐️ Static Site Generators with Python](#%EF%B8%8F-static-site-generators-with-python)
|
- [⭐️ Static Site Generators with Python](#%EF%B8%8F-static-site-generators-with-python)
|
||||||
- [⭐️ mdBook (Rust)](#%EF%B8%8F-mdbook-rust)
|
|
||||||
- [⭐️ Flutter Web](#%EF%B8%8F-flutter-web)
|
|
||||||
- [⭐️ Elm](#%EF%B8%8F-elm)
|
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [About the author](#about-the-author)
|
- [About the author](#about-the-author)
|
||||||
|
|
||||||
@@ -148,20 +117,20 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@master
|
||||||
# with:
|
# with:
|
||||||
# submodules: true
|
# submodules: true
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2.2.2
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.59.1'
|
hugo-version: '0.58.3'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
run: hugo --gc --minify
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -196,7 +165,6 @@ PUBLISH_BRANCH: master # deploying branch
|
|||||||
[User and Organization Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#user-and-organization-pages-sites
|
[User and Organization Pages sites]: https://help.github.com/en/articles/user-organization-and-project-pages#user-and-organization-pages-sites
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||
|
|
||||||
<div align="right">
|
<div align="right">
|
||||||
<a href="#table-of-contents">Back to TOC ☝️</a>
|
<a href="#table-of-contents">Back to TOC ☝️</a>
|
||||||
@@ -212,8 +180,8 @@ You can pull a public docker image from Docker Hub.
|
|||||||
By pulling docker images, you can reduce the overall execution time of your workflow. In addition, `latest` tag is provided.
|
By pulling docker images, you can reduce the overall execution time of your workflow. In addition, `latest` tag is provided.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
- uses: peaceiris/actions-gh-pages@v2
|
- uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
+ uses: docker://peaceiris/gh-pages:v2
|
+ uses: docker://peaceiris/gh-pages:v2.5.0
|
||||||
```
|
```
|
||||||
|
|
||||||
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
- [peaceiris/gh-pages - Docker Hub](https://hub.docker.com/r/peaceiris/gh-pages)
|
||||||
@@ -250,7 +218,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -267,7 +235,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -286,7 +254,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
EXTERNAL_REPOSITORY: username/external-repository
|
EXTERNAL_REPOSITORY: username/external-repository
|
||||||
@@ -299,112 +267,6 @@ When you use `ACTIONS_DEPLOY_KEY`, set your private key to the repository which
|
|||||||
|
|
||||||
Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
|
Be careful, `GITHUB_TOKEN` has no permission to access to external repositories.
|
||||||
|
|
||||||
### ⭐️ Force orphan
|
|
||||||
|
|
||||||
From `v2.6.0`, we can set the `forceOrphan: true` option.
|
|
||||||
This allows you to make your publish branch with only the latest commit.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
||||||
PUBLISH_BRANCH: gh-pages
|
|
||||||
PUBLISH_DIR: ./public
|
|
||||||
with:
|
|
||||||
forceOrphan: true
|
|
||||||
```
|
|
||||||
|
|
||||||
### ⭐️ Set Git username and email
|
|
||||||
|
|
||||||
Set custom `git config user.name` and `git config user.email`.
|
|
||||||
A commit is always created with the same user.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- 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: "iris@peaceiris.com"
|
|
||||||
```
|
|
||||||
|
|
||||||
### ⭐️ Set custom commit message
|
|
||||||
|
|
||||||
Set custom commit message.
|
|
||||||
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}`.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- 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 }}
|
|
||||||
```
|
|
||||||
|
|
||||||
### ⭐️ Create Git tag
|
|
||||||
|
|
||||||
Here is an example workflow.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
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.
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ # 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.
|
|
||||||
|
|
||||||
### ⭐️ Script mode
|
### ⭐️ Script mode
|
||||||
|
|
||||||
From `v2.5.0`, we can run this action as a shell script.
|
From `v2.5.0`, we can run this action as a shell script.
|
||||||
@@ -421,7 +283,7 @@ There is no Docker build or pull step, so it will start immediately.
|
|||||||
PUBLISH_DIR: ./public
|
PUBLISH_DIR: ./public
|
||||||
SCRIPT_MODE: true
|
SCRIPT_MODE: true
|
||||||
run: |
|
run: |
|
||||||
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2/entrypoint.sh
|
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh
|
||||||
bash ./entrypoint.sh
|
bash ./entrypoint.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -515,27 +377,18 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: build
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
|
- run: |
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: deploy
|
||||||
uses: actions/cache@v1
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- run: npm run build
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -563,31 +416,27 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: setup node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: install
|
||||||
uses: actions/cache@v1
|
run: npm install
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- run: npm ci
|
- name: format
|
||||||
|
run: npm run format
|
||||||
|
|
||||||
- run: npm run format
|
- name: test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
- run: npm run test
|
- name: build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
- run: npm run build
|
- name: deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -617,35 +466,27 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: setup node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: Get yarn cache
|
- name: install
|
||||||
id: yarn-cache
|
run: yarn install
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: build
|
||||||
uses: actions/cache@v1
|
run: yarn build
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-yarn-
|
|
||||||
|
|
||||||
- run: yarn install
|
- name: export
|
||||||
|
run: yarn export
|
||||||
|
|
||||||
- run: yarn build
|
- name: add nojekyll
|
||||||
|
run: touch ./out/.nojekyll
|
||||||
- run: yarn export
|
|
||||||
|
|
||||||
- run: touch ./out/.nojekyll
|
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -675,29 +516,24 @@ jobs:
|
|||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: setup node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: install
|
||||||
uses: actions/cache@v1
|
run: npm install
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- run: npm ci
|
- name: test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
- run: npm test
|
- name: generate
|
||||||
|
run: npm run generate
|
||||||
- run: npm run generate
|
|
||||||
|
|
||||||
- name: deploy
|
- name: deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
@@ -730,161 +566,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: '3.6'
|
python-version: '3.6'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
python3 -m pip install -r ./requirements.txt
|
pip install -r ./requirements.txt
|
||||||
|
|
||||||
- run: mkdocs build
|
- name: Build
|
||||||
|
run: mkdocs build
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v2.5.0
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
PUBLISH_BRANCH: gh-pages
|
||||||
PUBLISH_DIR: ./site
|
PUBLISH_DIR: ./site
|
||||||
```
|
```
|
||||||
|
|
||||||
### ⭐️ mdBook (Rust)
|
|
||||||
|
|
||||||
An example GitHub Actions workflow to deploy [rust-lang/mdBook] site to GitHub Pages.
|
|
||||||
|
|
||||||
[rust-lang/mdBook]: https://github.com/rust-lang/mdBook
|
|
||||||
|
|
||||||
- [peaceiris/actions-mdbook: GitHub Actions for mdBook (rust-lang/mdBook)](https://github.com/peaceiris/actions-mdbook)
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: github pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Setup mdBook
|
|
||||||
uses: peaceiris/actions-mdbook@v1
|
|
||||||
with:
|
|
||||||
mdbook-version: '0.3.5'
|
|
||||||
# mdbook-version: 'latest'
|
|
||||||
|
|
||||||
- run: mdbook build
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
||||||
PUBLISH_BRANCH: gh-pages
|
|
||||||
PUBLISH_DIR: ./book
|
|
||||||
```
|
|
||||||
|
|
||||||
### ⭐️ Flutter Web
|
|
||||||
|
|
||||||
An exapmle workflow for [Flutter web project].
|
|
||||||
Setup [Flutter] with [subosito/flutter-action].
|
|
||||||
|
|
||||||
[Flutter]: https://github.com/flutter/flutter
|
|
||||||
[Flutter web project]: https://flutter.dev/docs/get-started/web
|
|
||||||
[subosito/flutter-action]: https://github.com/subosito/flutter-action
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: github pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-deploy:
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
|
|
||||||
- name: Setup Flutter
|
|
||||||
uses: subosito/flutter-action@v1
|
|
||||||
with:
|
|
||||||
channel: 'beta'
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: |
|
|
||||||
flutter config --enable-web
|
|
||||||
flutter pub get
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: flutter build web
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
||||||
PUBLISH_BRANCH: gh-pages
|
|
||||||
PUBLISH_DIR: ./build/web
|
|
||||||
```
|
|
||||||
|
|
||||||
### ⭐️ Elm
|
|
||||||
|
|
||||||
An exapmle workflow for [Elm] with [justgook/setup-elm].
|
|
||||||
|
|
||||||
[Elm]: https://elm-lang.org
|
|
||||||
[justgook/setup-elm]: https://github.com/justgook/setup-elm
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: github pages
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Setup Elm
|
|
||||||
uses: justgook/setup-elm@v1
|
|
||||||
|
|
||||||
- name: Make
|
|
||||||
run: elm make --optimize src/Main.elm
|
|
||||||
|
|
||||||
- name: Move files
|
|
||||||
run: |
|
|
||||||
mkdir ./public
|
|
||||||
mv ./index.html ./public/
|
|
||||||
# If you have non-minimal setup with some assets and separate html/js files,
|
|
||||||
# provide --output=<output-file> option for `elm make` and remove this step
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
|
||||||
env:
|
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
||||||
PUBLISH_BRANCH: gh-pages
|
|
||||||
PUBLISH_DIR: ./public
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
21
action.yml
21
action.yml
@@ -1,4 +1,4 @@
|
|||||||
name: 'GitHub Pages action'
|
name: 'Deploy action for GitHub Pages'
|
||||||
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
||||||
author: 'peaceiris'
|
author: 'peaceiris'
|
||||||
runs:
|
runs:
|
||||||
@@ -20,22 +20,3 @@ inputs:
|
|||||||
description: 'Keep only the latest commit on a GitHub Pages branch'
|
description: 'Keep only the latest commit on a GitHub Pages branch'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
username:
|
|
||||||
description: 'Set Git user.name'
|
|
||||||
required: false
|
|
||||||
useremail:
|
|
||||||
description: 'Set Git user.email'
|
|
||||||
required: false
|
|
||||||
commitMessage:
|
|
||||||
description: 'Set custom commit message'
|
|
||||||
required: false
|
|
||||||
tagName:
|
|
||||||
description: 'Set tag name'
|
|
||||||
required: false
|
|
||||||
tagMessage:
|
|
||||||
description: 'Set tag message'
|
|
||||||
required: false
|
|
||||||
tagOverwrite:
|
|
||||||
description: 'Enable overwriting tag'
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ elif [ -n "${GITHUB_TOKEN}" ]; then
|
|||||||
print_error "GITHUB_TOKEN works only private repo, See #9"
|
print_error "GITHUB_TOKEN works only private repo, See #9"
|
||||||
|
|
||||||
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
||||||
print_error "can not use GITHUB_TOKEN to deploy to an external repository"
|
print_error "can not use GITHUB_TOKEN to deploy to a external repository"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ elif git clone --depth=1 --single-branch --branch "${remote_branch}" "${remote_r
|
|||||||
git rm -r --ignore-unmatch '*'
|
git rm -r --ignore-unmatch '*'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 -not -name ".git" -not -name ".github" | \
|
find "${GITHUB_WORKSPACE}/${PUBLISH_DIR}" -maxdepth 1 | \
|
||||||
tail -n +2 | \
|
tail -n +2 | \
|
||||||
xargs -I % cp -rf % "${local_dir}/"
|
xargs -I % cp -rf % "${local_dir}/"
|
||||||
else
|
else
|
||||||
@@ -102,34 +102,14 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# push to publishing branch
|
# push to publishing branch
|
||||||
if [[ -n "${INPUT_USERNAME}" ]]; then
|
git config user.name "${GITHUB_ACTOR}"
|
||||||
git config user.name "${INPUT_USERNAME}"
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||||
else
|
|
||||||
git config user.name "${GITHUB_ACTOR}"
|
|
||||||
fi
|
|
||||||
if [[ -n "${INPUT_USEREMAIL}" ]]; then
|
|
||||||
git config user.email "${INPUT_USEREMAIL}"
|
|
||||||
else
|
|
||||||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
||||||
fi
|
|
||||||
git remote rm origin || true
|
git remote rm origin || true
|
||||||
git remote add origin "${remote_repo}"
|
git remote add origin "${remote_repo}"
|
||||||
git add --all
|
git add --all
|
||||||
|
|
||||||
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
|
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
|
||||||
|
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
|
||||||
if [ -n "${INPUT_COMMITMESSAGE}" ]; then
|
|
||||||
BASE_COMMIT_MESSAGE="${INPUT_COMMITMESSAGE}"
|
|
||||||
else
|
|
||||||
BASE_COMMIT_MESSAGE="Automated deployment: $(date -u)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${EXTERNAL_REPOSITORY}" ]; then
|
|
||||||
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_REPOSITORY}@${GITHUB_SHA}"
|
|
||||||
else
|
|
||||||
COMMIT_MESSAGE="${BASE_COMMIT_MESSAGE} ${GITHUB_SHA}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
|
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
|
||||||
git commit -m "${COMMIT_MESSAGE}" || skip
|
git commit -m "${COMMIT_MESSAGE}" || skip
|
||||||
else
|
else
|
||||||
@@ -142,22 +122,4 @@ else
|
|||||||
git push origin "${remote_branch}"
|
git push origin "${remote_branch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${INPUT_TAGNAME}" ]]; then
|
|
||||||
print_info "Tag name: ${INPUT_TAGNAME}"
|
|
||||||
print_info "Tag message: ${INPUT_TAGMESSAGE}"
|
|
||||||
print_info "Tag overwrite: ${INPUT_TAGOVERWRITE}"
|
|
||||||
if [[ -n "${INPUT_TAGMESSAGE}" ]]; then
|
|
||||||
GIT_TAG_MESSAGE="${INPUT_TAGMESSAGE}"
|
|
||||||
else
|
|
||||||
GIT_TAG_MESSAGE="Deployment ${INPUT_TAGNAME}"
|
|
||||||
fi
|
|
||||||
if [[ "${INPUT_TAGOVERWRITE}" == "true" ]]; then
|
|
||||||
GIT_TAG_OPTION="--force"
|
|
||||||
else
|
|
||||||
GIT_TAG_OPTION=""
|
|
||||||
fi
|
|
||||||
git tag "${GIT_TAG_OPTION}" -a "${INPUT_TAGNAME}" -m "${GIT_TAG_MESSAGE}"
|
|
||||||
git push "${GIT_TAG_OPTION}" origin "${INPUT_TAGNAME}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
print_info "${GITHUB_SHA} was successfully deployed"
|
print_info "${GITHUB_SHA} was successfully deployed"
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
Reference in New Issue
Block a user