From b6b420f7546047b2906e7cb89e71d658f6a11e78 Mon Sep 17 00:00:00 2001 From: finmoon Date: Thu, 9 Oct 2025 12:27:04 +0000 Subject: [PATCH 1/2] Delete .gitea/workflows/demo.yaml --- .gitea/workflows/demo.yaml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .gitea/workflows/demo.yaml diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index 97ff4c4..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event" - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file -- 2.49.1 From 9b92390d63bef8015d030517f458b915e36acfb4 Mon Sep 17 00:00:00 2001 From: finmoon Date: Thu, 9 Oct 2025 12:33:46 +0000 Subject: [PATCH 2/2] Add .gitea/workflows/build_and_deploy.yaml --- .gitea/workflows/build_and_deploy.yaml | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .gitea/workflows/build_and_deploy.yaml diff --git a/.gitea/workflows/build_and_deploy.yaml b/.gitea/workflows/build_and_deploy.yaml new file mode 100644 index 0000000..7397e92 --- /dev/null +++ b/.gitea/workflows/build_and_deploy.yaml @@ -0,0 +1,73 @@ +name: Build and Deploy Zola Site + +on: + push: + branches: + - main # Or whichever branch you want to deploy from + +jobs: + #---------------------------------------------------- + # JOB 1: Build the static site with Zola + #---------------------------------------------------- + build: + runs-on: ubuntu-latest + steps: + # Step 1: Check out the main website repository's code + - name: Checkout Website Source + uses: actions/checkout@v4 + with: + path: main-site + + # Step 2: Check out the theme repository into the correct folder + # Replace 'YourUsername/YourThemeRepo' with your actual Gitea theme repository + - name: Checkout Theme + uses: actions/checkout@v4 + with: + repository: finmoon/moon-anemone + path: main-site/themes/anemone + + # Step 3: Install the Zola static site generator + - name: Install Zola + uses: taiki-e/install-action@v2 + with: + tool: zola + + # Step 4: Run the build command + # Zola will generate the site in the 'main-site/public' directory + - name: Build Site + run: | + cd main-site + zola build + + # Step 5: Upload the 'public' directory as an artifact + # This makes the build output available to other jobs (like our deploy job) + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: zola-public + path: main-site/public/ + + #---------------------------------------------------- + # JOB 2: Deploy the built site to the web server + #---------------------------------------------------- + deploy: + runs-on: ubuntu-latest + needs: build + steps: + # Step 1: Download the artifact from the 'build' job + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: zola-public + + # Step 2: Copy the files to the web server using SCP + - name: SCP files to server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "./*" # Copies the content of the downloaded artifact directory + target: "/var/www/html/finmoon" # The document root on your Apache server + strip_components: 1 # Removes the top-level directory from the source path + rm: true # Removes existing files in the target directory before copying \ No newline at end of file -- 2.49.1