Cleanup common
folder before checking out the theme
#8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build & deploy documentation | |
name: Build & Deploy | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push | |
push: | |
# Triggers the workflow on pull | |
pull_request: | |
# Run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: self-hosted | |
env: | |
PRODUCT: classification | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Submodule update | |
run: | | |
rm -rf common | |
git submodule update --init --recursive | |
git submodule foreach git pull origin master | |
- name: Install Hugo | |
run: | | |
curl -LO https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_extended_0.101.0_Linux-64bit.deb | |
sudo dpkg -i hugo_extended_0.101.0_Linux-64bit.deb | |
- name: Run and build Hugo | |
run: | | |
mkdir -p common/content/${{ env.PRODUCT }} | |
cp -r net common/content/${{ env.PRODUCT }} | |
cp _index.md common/content/${{ env.PRODUCT }} | |
hugo --source common --minify --config config-geekdoc.toml,ignore-total-config.toml,show-feedback-config.toml | |
- name: Deploy sitemap | |
uses: nogsantos/scp-deploy@master | |
with: | |
src: common/public/product-sitemap.xml | |
host: ${{ secrets.DOCS_SSH_HOST }} | |
remote: ${{ secrets.DOCS_SSH_DIR }}/sitemaps/${{ env.PRODUCT }}.xml | |
user: ${{ secrets.DOCS_SSH_USER }} | |
key: ${{ secrets.DOCS_SSH_KEY }} | |
# - name: Deploy documentation | |
# uses: burnett01/[email protected] | |
# with: | |
# switches: -vzr --delete | |
# path: common/public/${{ env.PRODUCT }} | |
# remote_path: ${{ secrets.DOCS_SSH_DIR }} | |
# remote_host: ${{ secrets.DOCS_SSH_HOST }} | |
# remote_user: ${{ secrets.DOCS_SSH_USER }} | |
# remote_key: ${{ secrets.DOCS_SSH_KEY }} | |
- name: Deploy documentation | |
uses: nogsantos/scp-deploy@master | |
with: | |
src: common/public/${{ env.PRODUCT }} | |
host: ${{ secrets.DOCS_SSH_HOST }} | |
remote: ${{ secrets.DOCS_SSH_DIR }} | |
user: ${{ secrets.DOCS_SSH_USER }} | |
key: ${{ secrets.DOCS_SSH_KEY }} | |