mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-04-05 07:06:08 +00:00
Fix docs publishing
This commit is contained in:
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -195,3 +195,50 @@ jobs:
|
||||
files: |
|
||||
./firezone*.rpm
|
||||
./firezone*.deb
|
||||
publish-docs:
|
||||
needs: publish
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
- name: Write tags manifest
|
||||
run: |
|
||||
echo ${{ steps.get_version.outputs.VERSION }} > docs/assets/versions.txt
|
||||
tags=`git ls-tree --name-only origin/gh-pages | egrep "^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$"`
|
||||
echo $tags | tr " " "\n" >> docs/assets/versions.txt
|
||||
- name: Build jekyll site
|
||||
run: |
|
||||
cd docs/
|
||||
gem install bundler
|
||||
bundle install
|
||||
|
||||
# Generate top-level docs
|
||||
bundle exec jekyll build \
|
||||
--destination _latest
|
||||
|
||||
# Generate versioned docs
|
||||
bundle exec jekyll build \
|
||||
--baseurl ${{ steps.get_version.outputs.VERSION }} \
|
||||
--destination ${{ steps.get_version.outputs.VERSION }}
|
||||
- name: Publish Latest Docs
|
||||
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/_latest
|
||||
target-folder: .
|
||||
clean: false
|
||||
- name: Publish Versioned Docs
|
||||
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/${{ steps.get_version.outputs.VERSION }}
|
||||
target-folder: ${{ steps.get_version.outputs.VERSION }}
|
||||
clean: false
|
||||
|
||||
54
.github/workflows/docs.yml
vendored
54
.github/workflows/docs.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: docs
|
||||
on:
|
||||
- push
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
publish-docs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
- name: Write tags manifest
|
||||
run: |
|
||||
echo ${{ steps.get_version.outputs.VERSION }} > docs/assets/versions.txt
|
||||
tags=`git ls-tree --name-only origin/gh-pages | egrep "^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$"`
|
||||
echo $tags | tr " " "\n" >> docs/assets/versions.txt
|
||||
- name: Build jekyll site
|
||||
run: |
|
||||
cd docs/
|
||||
gem install bundler
|
||||
bundle install
|
||||
|
||||
# Generate top-level docs
|
||||
bundle exec jekyll build \
|
||||
--destination _latest
|
||||
|
||||
# Generate versioned docs
|
||||
bundle exec jekyll build \
|
||||
--baseurl ${{ steps.get_version.outputs.VERSION }} \
|
||||
--destination ${{ steps.get_version.outputs.VERSION }}
|
||||
- name: Publish Latest Docs
|
||||
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/_latest
|
||||
target-folder: .
|
||||
clean: false
|
||||
- name: Publish Versioned Docs
|
||||
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: docs/${{ steps.get_version.outputs.VERSION }}
|
||||
target-folder: ${{ steps.get_version.outputs.VERSION }}
|
||||
clean: false
|
||||
Reference in New Issue
Block a user