Skip to content

Commit

Permalink
Merge branch 'main' into docs-update-for-trails
Browse files Browse the repository at this point in the history
  • Loading branch information
jumboduck committed Dec 19, 2023
2 parents d225f12 + 61836e2 commit 28dc131
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_branch_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish branch docs

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Generate json
run: |
echo '{"currentversion": "staging-docs"}' > docs.kosli.com/assets/metadata.json
# Deploy to local repo
- name: Deploy
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: staging-docs
FOLDER: docs.kosli.com
TARGET_DIR: docs.kosli.com
# The action takes all the files from FOLDER on main branch and copies them to TARGET_DIR
# on docs-main branch. That branch contains only docs.kosli.com folder
#
# CLEAR_GLOBS_FILE is a way to define which files and folders on TARGET_DIR to delete before
# copying from main, and which to keep (the ones starting with '!')
#
# In our case, cli reference md files, and docs.kosli.com/assets/metadata.json
# are not part of the repository - they get generated only in release workflow.
# When they get generated they are also copied to docs-main branch, and we don't need to preserve
# anything from previous version of docs-main branch - hence no CLEAR_GLOBS_FILE in release.yml.
#
# When we release just static content, the cli reference md files, and
# docs.kosli.com/assets/metadata.json are not present, but we use CLEAR_GLOBS_FILE to preserve
# their versions pushed to docs-main during last release - hence CLEAR_GLOBS_FILE in
# publish_docs.yml, to prevent removing them before copying
# CLEAR_GLOBS_FILE: ".clear-files"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 28dc131

Please sign in to comment.