diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7cc7207..b0aaafd 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -13,39 +13,25 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + submodules: true - name: Install Hugo uses: peaceiris/actions-hugo@v2 with: hugo-version: 'latest' - extended: true # Install extended version + extended: true - - name: Debug Working Directory - run: | - pwd - ls -la - echo "Current directory structure:" - find . -type f - echo "Mount point check:" - ls -la /data/hugo/public || echo "Mount point not accessible" + - name: Build Site + run: hugo --minify - - name: Build Hugo Site + - name: Setup SSH run: | - # Create the target directory if it doesn't exist - mkdir -p /data/hugo/public - chown -R root:root /data/hugo - - # Build directly in the workspace - hugo --minify - - echo "Contents of generated public directory:" - ls -la public/ - - echo "Copying files to mounted volume..." - rm -rf /data/hugo/public/* # Clean target directory first - cp -rv public/* /data/hugo/public/ - - echo "Final contents of mounted volume:" - ls -la /data/hugo/public/ \ No newline at end of file + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + # Add localhost to known hosts to avoid prompt + ssh-keyscan -H localhost >> ~/.ssh/known_hosts + + - name: Copy Files to App Server + run: | + rsync -avz --delete public/ john@localhost:/home/john/mine/scripts/hugo/public/ \ No newline at end of file