action: build
This commit is contained in:
parent
89a255bd13
commit
4c8dda7cdf
1 changed files with 62 additions and 2 deletions
|
@ -4,7 +4,67 @@ on:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
runs-on: vps
|
runs-on: vps
|
||||||
|
|
||||||
|
env:
|
||||||
|
# This variable allow to build for either doc.yunohost.org or nextdoc.yunohost.org
|
||||||
|
BUILD_FOR: ${{ forge.ref == 'refs/heads/main' && 'main' || 'next' }}
|
||||||
|
|
||||||
|
name: Build Docs
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- run: echo All good!
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# - name: Check image paths consistency
|
||||||
|
# run: bash scripts/check_missing_or_bad_image_path.sh
|
||||||
|
|
||||||
|
# - name: Set up Python
|
||||||
|
# uses: actions/setup-python@v5
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: lts/*
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
|
- name: Installation
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
# - name: Check translations pages consistency
|
||||||
|
# run: python3 ./scripts/check_i18n_consistency.py
|
||||||
|
|
||||||
|
- name: Build docs
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Archive the docs
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docs
|
||||||
|
path: build/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy the new doc
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: ${{forge.event_name == 'push' && ( forge.ref == 'refs/heads/main' || forge.ref == 'refs/heads/next' ) }}
|
||||||
|
env:
|
||||||
|
APP: ${{ forge.ref == 'refs/heads/main' && 'my_webapp' || 'my_webapp__4' }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download the built docs artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docs
|
||||||
|
path: docs
|
||||||
|
|
||||||
|
- name: Install tools
|
||||||
|
run: |
|
||||||
|
sudo apt install sshpass rsync
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: sshpass -p ${{ secrets.DOC_SFTP_PWD }}
|
||||||
|
rsync -avz --delete
|
||||||
|
-e "ssh -o StrictHostKeyChecking=no"
|
||||||
|
docs/ ${APP}@apicius.yunohost.org:~/www/
|
||||||
|
|
Loading…
Reference in a new issue