feat: new deploy.yml

This commit is contained in:
Filippo Ferrari 2024-02-16 22:48:55 +01:00
parent b6b0c890df
commit 91e57a4e40

View file

@ -1,49 +1,50 @@
name: Deploy to Github Pages name: Deploy to Home Server
on: on:
push: push:
branches: [master] branches: [master]
pull_request: pull_request:
branches: [master] branches: [master]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the contents: write
# added or changed files to the repository.
contents: write
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache Hugo resources - name: Cache Hugo resources
uses: actions/cache@v3 uses: actions/cache@v3
env: env:
cache-name: cache-hugo-resources cache-name: cache-hugo-resources
with: with:
path: resources path: resources
key: ${{ env.cache-name }} key: ${{ env.cache-name }}
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: "^1.17.0" go-version: "^1.17.0"
- run: go version
- name: Setup Hugo - run: go version
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
extended: true
- name: Build - name: Setup Hugo
run: hugo --minify --gc 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