From 90e703e7400bb4a920c080b773a1af6a26ed5eb1 Mon Sep 17 00:00:00 2001 From: PeaceNira Date: Sat, 1 Feb 2025 19:06:31 +0000 Subject: [PATCH] testing workflow --- .forgejo/workflows/push.yaml | 37 +++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/push.yaml b/.forgejo/workflows/push.yaml index f501f6b..e7e3ca3 100644 --- a/.forgejo/workflows/push.yaml +++ b/.forgejo/workflows/push.yaml @@ -4,25 +4,36 @@ on: push: branches: - 'main' -# paths: -# - src/**/* jobs: build: - runs-on: docker + runs-on: ubuntu-latest steps: - # get the repo first + # Step 1: Checkout the repository - uses: https://code.forgejo.org/actions/checkout@v4 - # Make sure all files are pulled down - - uses: https://forgejo.skynet.ie/Skynet/actions/get_lfs@v6 - with: - repository: ${{ gitea.repository }} - ref_name: ${{ gitea.ref_name }} - # temp one just to get it "built" + + # Step 2: Install latest Hugo (im not sure if sudo is allowed here... it should be?) + - name: Install Hugo + run: | + sudo apt-get update + HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep -Po '"tag_name": "\K[^"]+') + wget -q https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-amd64.deb + sudo apt install -y ./hugo_extended_${HUGO_VERSION}_Linux-amd64.deb + hugo version + + # Step 3: Ensure submodules or themes are initialized (only needed if your using github submodules for theme purposes) + - name: Initialize Submodules + run: git submodule update --init --recursive + + # Step 4: Build the Hugo site + - name: Build Hugo site + env: + HUGO_ENV: production + run: hugo --minify # Reduce resources by minifying content + + # Step 5: Deploy the /public directory to the server - uses: https://forgejo.skynet.ie/Skynet/actions/deploy_user@v6 with: ssh_key: ${{ secrets.SSH_KEY }} username: ${{ env.GITHUB_REPOSITORY_OWNER }} - folder: "src" - # uncomment below if you want to deploy to a subfolder - #destination: "subfolder" \ No newline at end of file + folder: "public" \ No newline at end of file