Update action.yml
This commit is contained in:
parent
b88134d13b
commit
12ade96a9b
34
action.yml
34
action.yml
|
@ -6,6 +6,15 @@ inputs:
|
||||||
site-dirname:
|
site-dirname:
|
||||||
description: "Site directory (inside /var/www/html/alice_sites) name"
|
description: "Site directory (inside /var/www/html/alice_sites) name"
|
||||||
default: ${{ github.event.repository.name }}
|
default: ${{ github.event.repository.name }}
|
||||||
|
source-dir:
|
||||||
|
description: "Source directory"
|
||||||
|
default: "/var/www/src/alice_sites"
|
||||||
|
dest-dir:
|
||||||
|
description: "Destination directory"
|
||||||
|
default: "/var/www/html/alice_sites"
|
||||||
|
jekyll-args:
|
||||||
|
description: "Args to pass to jekyll build"
|
||||||
|
default: "--trace --incremental"
|
||||||
skip-build:
|
skip-build:
|
||||||
description: "Wheather or not the sites skips building"
|
description: "Wheather or not the sites skips building"
|
||||||
default: "false"
|
default: "false"
|
||||||
|
@ -30,21 +39,28 @@ runs:
|
||||||
SITE_DIRNAME: ${{ inputs.site-dirname }}
|
SITE_DIRNAME: ${{ inputs.site-dirname }}
|
||||||
REPO_NAME: ${{ gitea.repository }}
|
REPO_NAME: ${{ gitea.repository }}
|
||||||
SKIP_BUILD: ${{ inputs.skip-build }}
|
SKIP_BUILD: ${{ inputs.skip-build }}
|
||||||
|
SOURCE_DIR: ${{ inputs.source-dir }}
|
||||||
|
DEST_DIR: ${{ inputs.dest-dir }}
|
||||||
|
JEKYLL_ARGS: ${{ inputs.jekyll-args }}
|
||||||
with:
|
with:
|
||||||
host: ${{ inputs.host }}
|
host: ${{ inputs.host }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
key: ${{ inputs.key }}
|
key: ${{ inputs.key }}
|
||||||
port: ${{ inputs.port }}
|
port: ${{ inputs.port }}
|
||||||
envs: SITE_DIRNAME, REPO_NAME, SKIP_BUILD
|
envs: SITE_DIRNAME, REPO_NAME, SKIP_BUILD, SOURCE_DIR, DEST_DIR, JEKYLL_ARGS
|
||||||
script: |
|
script: |
|
||||||
SITES_DIR="/var/www/src/alice_sites"
|
|
||||||
|
|
||||||
# if site is not there yet, clone it
|
cd $SOURCE_DIR
|
||||||
[ -d "${SITES_DIR}/${SITE_DIRNAME}" ] ||
|
|
||||||
sudo -u www-data "git clone https://git.alice.ufsj.edu.br/$REPO_NAME"
|
|
||||||
|
|
||||||
cd "${SITES_DIR}/${SITE_DIRNAME}"
|
# If site is not there yet, clone it
|
||||||
sudo -u www-data git pull
|
[ -d "${SOURCE_DIR}/${SITE_DIRNAME}" ] ||
|
||||||
|
git clone https://git.alice.ufsj.edu.br/$REPO_NAME
|
||||||
|
|
||||||
|
# Update
|
||||||
|
cd "${SOURCE_DIR}/${SITE_DIRNAME}"
|
||||||
|
git pull
|
||||||
|
|
||||||
|
# Build
|
||||||
[ $SKIP_BUILD != false ] && exit 0
|
[ $SKIP_BUILD != false ] && exit 0
|
||||||
sudo -u www-data bundle install
|
bundle install
|
||||||
sudo -u www-data make deploy
|
bundle exec jekyll build $JEKYLL_ARGS --destination=$DEST_DIR/$SITE_DIRNAME
|
Loading…
Reference in New Issue