Files
vagrant-libvirt/.github/workflows/publish-documentation-release.yml
2023-02-07 16:38:59 +00:00

47 lines
1.4 KiB
YAML

name: Deploy Docs Release
on:
push:
tags:
- '*.*.*'
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install and Build 🔧
run: |
VERSION=${{ github.ref_name }}
REPO_NAME=$(jq -r ".repository.name" "$GITHUB_EVENT_PATH")
# 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
# 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 >> docs/_config.yml
repository_nwo: vagrant-libvirt/vagrant-libvirt
EOF
BUNDLE_GEMFILE=./docs/Gemfile bundle install
BUNDLE_GEMFILE=./docs/Gemfile bundle exec jekyll build --source docs/ --baseurl="/${REPO_NAME}/version/${VERSION}" --destination build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: build
clean: true
force: false
target-folder: version/${{ github.ref_name }}
clean-exclude: |
pr-preview/
version/