From 91e57a4e40169b0d0c846d377bf403fc051fbc1a Mon Sep 17 00:00:00 2001 From: Filippo Ferrari Date: Fri, 16 Feb 2024 22:48:55 +0100 Subject: [PATCH] feat: new deploy.yml --- .github/workflows/deploy.yml | 77 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5471f5c..62af3e5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,49 +1,50 @@ -name: Deploy to Github Pages +name: Deploy to Home Server on: - push: - branches: [master] - pull_request: - branches: [master] + push: + branches: [master] + pull_request: + branches: [master] jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the - # added or changed files to the repository. - contents: write + permissions: + contents: write - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v3 - - name: Cache Hugo resources - uses: actions/cache@v3 - env: - cache-name: cache-hugo-resources - with: - path: resources - key: ${{ env.cache-name }} + - name: Cache Hugo resources + uses: actions/cache@v3 + env: + cache-name: cache-hugo-resources + with: + path: resources + key: ${{ env.cache-name }} - - uses: actions/setup-go@v4 - with: - go-version: "^1.17.0" - - run: go version + - uses: actions/setup-go@v4 + with: + go-version: "^1.17.0" - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: "latest" - extended: true + - run: go version - - name: Build - run: hugo --minify --gc + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "latest" + extended: true + + - name: Build + run: hugo --minify --gc + + - name: Deploy 🚀 + uses: easingthemes/ssh-deploy@v2 + with: + server: ${{ secrets.SERVER_DOMAIN }} + username: ${{ secrets.SERVER_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + local: ./public + remote: /var/www/html/ - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: public - clean: true - single-commit: true