diff --git a/README.md b/README.md index 9512d6f..1a9aab5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# TTPages action workflow -This repository contains the source code of the TTPages workflow for TTGit Actions. +# Jekyll action workflow +This repository contains the source code of the Jekyll action for TTGit Actions. ## Usage of the workflow @@ -11,10 +11,10 @@ Usage example: ```yaml steps: - - name: Publish to TTPages - uses https://git.ttnrtsite.me/actions/ttpages - with: - path: + - name: Setup Jekyll + uses: https://git.ttnrtsite.me/actions/jekyll + - name: Check ruby version + run: ruby -v ``` The workflow would then look like this: @@ -36,10 +36,8 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Publish site - uses: https://git.ttnrtsite.me/actions/ttpages - with: - path: output_folder -``` - -If you use a static site generator, you may add other steps to publish your website data. \ No newline at end of file + - name: Setup Jekyll + uses: https://git.ttnrtsite.me/actions/jekyll + - name: Check ruby version + run: ruby -v +``` \ No newline at end of file diff --git a/action.yml b/action.yml index c51e80b..9e8b7ca 100644 --- a/action.yml +++ b/action.yml @@ -1,16 +1,11 @@ --- -name: 'TTPages' -description: 'Publish your static web content for TTPages' +name: 'Jekyll' +description: 'Setup jekyll for TTGit actions' -inputs: - path: - description: 'The path to content to publish' - required: false - default: 'dist' runs: using: 'composite' steps: - - id: ttpages-action - run: $GITHUB_ACTION_PATH/run.sh '${{ inputs.path }}' + - name: Install packages + run: $GITHUB_ACTION_PATH/run.sh shell: bash \ No newline at end of file diff --git a/run.sh b/run.sh index da3bcc8..523b055 100644 --- a/run.sh +++ b/run.sh @@ -2,37 +2,10 @@ set -eo pipefail -check_command() { - command -v "$1" >/dev/null 2>&1 -} +apt update -if ! check_command git; then - echo "git not found, please install it!" - exit 1 -fi +apt install ruby ruby-dev -y -if [ $# -ne 1 ]; then - echo "Usage: $(basename "$0") " - exit 1 -fi +gem install bundler -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 \ No newline at end of file +echo "Done!"