mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Use of tee requires the argument '-a' to append, as current behaviour will result in replacing the contents which is not intended. The config settings should be in addition to the configured values.
57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: Build Docs
|
|
inputs:
|
|
extra-config:
|
|
required: false
|
|
type: string
|
|
target-folder:
|
|
require: false
|
|
type: string
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Set up Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: 2.7
|
|
|
|
- name: Configure
|
|
shell: bash
|
|
env:
|
|
TARGET_FOLDER: ${{ inputs.target-folder }}
|
|
EXTRA_CONFIG: ${{ inputs.extra-config }}
|
|
run: |
|
|
[[ ${RUNNER_DEBUG:-0} -eq 1 ]] && set -x
|
|
|
|
REPO_NAME=$(jq -r ".repository.name" "$GITHUB_EVENT_PATH")
|
|
|
|
TEMP_CONFIG=$(mktemp)
|
|
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk
|
|
cat <<EOF >> ${TEMP_CONFIG}
|
|
repository_nwo: ${GITHUB_REPOSITORY}
|
|
EOF
|
|
|
|
if [[ -n "${TARGET_FOLDER}" ]]
|
|
then
|
|
echo "baseurl: /${REPO_NAME}/${TARGET_FOLDER}" >> ${TEMP_CONFIG}
|
|
fi
|
|
|
|
# allow override of everything
|
|
cat <<EOF >> ${TEMP_CONFIG}
|
|
${EXTRA_CONFIG}
|
|
EOF
|
|
|
|
echo "Adding additional config settings:"
|
|
cat ${TEMP_CONFIG} | tee -a docs/_config.yml
|
|
|
|
- name: Install and Build
|
|
shell: bash
|
|
env:
|
|
BUNDLE_GEMFILE: ./docs/Gemfile
|
|
run: |
|
|
# TODO find a way for jekyll to perform this automatically
|
|
convert docs/_assets/images/logo.png -define icon:auto-resize=256,64,48,32,16 docs/favicon.ico
|
|
|
|
bundle install
|
|
bundle exec jekyll build --source docs/ --destination build
|