-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.19 KB
/
build-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build and Deploy HTML to Production
on:
push:
branches: [ "main" ]
workflow_dispatch:
branches: [ "main" ]
jobs:
build-and-deploy-to-barge-dot-org:
runs-on: ubuntu-latest
environment: barge.org
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: checkout source
uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Hugo setup
uses: peaceiris/[email protected]
with:
hugo-version: 0.139.2
- name: build site with hugo
run: hugo --environment production
- name: rsync 'public' to production host
if: ${{ github.ref == 'refs/heads/main' }}
uses: burnett01/[email protected]
with:
path: public/
remote_host: ${{ secrets.HOST }}
remote_key: ${{ secrets.SSH_KEY }}
remote_path: /var/www/newbarge/
remote_port: ${{ secrets.PORT }}
remote_user: ${{ secrets.USERNAME }}
switches: -avzr --delete --exclude=".??*,*~"