revert 915cb756bf7cf64538ee44fba4a7043184865727
revert added files
This commit is contained in:
parent
915cb756bf
commit
8c0a58835c
22
README.md
22
README.md
@ -1,5 +1,5 @@
|
|||||||
# Jekyll action workflow
|
# TTPages action workflow
|
||||||
This repository contains the source code of the Jekyll action for TTGit Actions.
|
This repository contains the source code of the TTPages workflow for TTGit Actions.
|
||||||
|
|
||||||
## Usage of the workflow
|
## Usage of the workflow
|
||||||
|
|
||||||
@ -11,10 +11,10 @@ Usage example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Jekyll
|
- name: Publish to TTPages
|
||||||
uses: https://git.ttnrtsite.me/actions/jekyll
|
uses https://git.ttnrtsite.me/actions/ttpages
|
||||||
- name: Check ruby version
|
with:
|
||||||
run: ruby -v
|
path: <folder of static files>
|
||||||
```
|
```
|
||||||
|
|
||||||
The workflow would then look like this:
|
The workflow would then look like this:
|
||||||
@ -36,8 +36,10 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Jekyll
|
- name: Publish site
|
||||||
uses: https://git.ttnrtsite.me/actions/jekyll
|
uses: https://git.ttnrtsite.me/actions/ttpages
|
||||||
- name: Check ruby version
|
with:
|
||||||
run: ruby -v
|
path: output_folder
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you use a static site generator, you may add other steps to publish your website data.
|
13
action.yml
13
action.yml
@ -1,11 +1,16 @@
|
|||||||
---
|
---
|
||||||
name: 'Jekyll'
|
name: 'TTPages'
|
||||||
description: 'Setup jekyll for TTGit actions'
|
description: 'Publish your static web content for TTPages'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: 'The path to content to publish'
|
||||||
|
required: false
|
||||||
|
default: 'dist'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Install packages
|
- id: ttpages-action
|
||||||
run: $GITHUB_ACTION_PATH/run.sh
|
run: $GITHUB_ACTION_PATH/run.sh '${{ inputs.path }}'
|
||||||
shell: bash
|
shell: bash
|
35
run.sh
35
run.sh
@ -2,10 +2,37 @@
|
|||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
apt update
|
check_command() {
|
||||||
|
command -v "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
apt install ruby ruby-dev -y
|
if ! check_command git; then
|
||||||
|
echo "git not found, please install it!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
gem install bundler
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename "$0") <path>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Done!"
|
git config --global user.email "support@ttnrtsite.me"
|
||||||
|
git config --global user.name "TTGit Automation Bot"
|
||||||
|
git config --global --add --bool push.autoSetupRemote true
|
||||||
|
|
||||||
|
if ! git ls-remote --exit-code --heads origin pages; then
|
||||||
|
git checkout --orphan pages
|
||||||
|
git rm -rf .
|
||||||
|
else
|
||||||
|
git checkout pages
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -d "$1" ]; then
|
||||||
|
echo "$1 does not exist! Try setting inputs.path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -r "$1"/* . && rm -rf "$1"
|
||||||
|
git add -A
|
||||||
|
git commit -a -m "TTPages: Automated Update"
|
||||||
|
git push -u
|
Loading…
Reference in New Issue
Block a user