From 4c8dda7cdf85f12eebc653eb7b220f99690dee8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 2 Oct 2025 14:44:59 +0200 Subject: [PATCH] action: build --- .forgejo/workflows/build.yml | 64 ++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 7c5d36a..ed328b1 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -4,7 +4,67 @@ on: jobs: - test: + build: 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: - - 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/