From 49062cfa32246af1750bbcb4c794d10542ae0022 Mon Sep 17 00:00:00 2001 From: recanman <29310982+recanman@users.noreply.github.com> Date: Mon, 7 Oct 2024 03:30:10 +0000 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ae6782d..eb636bf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Build and Deploy Hugo Site +name: Deploy latest site on: push: @@ -6,24 +6,20 @@ on: - main jobs: - build: + deploy: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v2 - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: 'latest' + - name: Setup SSH + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id + chmod 600 ~/.ssh/id + echo "${{ secrets.SERVER_FINGERPRINT }}" >> ~/.ssh/known_hosts - - name: Build - run: hugo --minify - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public - publish_branch: pages \ No newline at end of file + - name: Run rotten-build command + run: | + ssh -o StrictHostKeyChecking=yes ${{ secrets.SSH_USERNAME }}@${{ secrets.SERVER_ADDRESS }} "sudo rotten-build"