-
Notifications
You must be signed in to change notification settings - Fork 352
60 lines (52 loc) · 1.99 KB
/
docs-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: documentation release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "specific version to publish"
jobs:
docs-release:
name: Documentation release
runs-on: ubuntu-22.04
steps:
- name: Check-out
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
ruby-version: '3.2'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Extract version
id: version
shell: bash
run: |
if [ "${{ github.event.inputs.tag }}" != "" ]; then
echo "tag=$(echo ${{ github.event.inputs.tag }} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
else
echo "tag=$(echo ${GITHUB_REF##*/} | cut -d. -f1-2)" >> $GITHUB_OUTPUT
fi
- name: Build release
working-directory: docs
run: bundle exec jekyll build --config _config.yml,_config.version.yml -d _site/${{ steps.version.outputs.tag }} -b /${{ steps.version.outputs.tag }}
- name: Remove robots.txt
working-directory: docs/_site/${{ steps.version.outputs.tag }}
run: |
if [[ -f robots.txt ]]; then rm robots.txt; fi
- name: Update published version
env:
API_TOKEN_GITHUB: ${{ secrets.PERSONAL_TOKEN }}
run: >
curl -s https://${API_TOKEN_GITHUB}@raw.githubusercontent.com/treeverse/docs-lakeFS/main/versions.json |
jq '."${{ steps.version.outputs.tag}}" = "${{ steps.version.outputs.tag}}"' > docs/_site/versions.json
- name: Publish to lakeFS-docs repository
env:
SSH_DEPLOY_KEY: '${{ secrets.SSH_LAKEFS_DOCS_DEPLOY_KEY }}'
SOURCE_DIRECTORY: 'docs/_site/'
GIT_CMD_REPOSITORY: '[email protected]:treeverse/docs-lakeFS.git'
USER_EMAIL: '[email protected]'
USER_NAME: 'docs-action'
shell: bash
run: ./.github/scripts/push-repo.sh