This commit is contained in:
parent
b0dec5a980
commit
9576f2499f
1 changed files with 32 additions and 0 deletions
32
.gitea/workflows/deploy.yml
Normal file
32
.gitea/workflows/deploy.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Build & Deploy
|
||||
on: [push, workflow_dispatch]
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.name ${{ secrets.GIT_USERNAME }}
|
||||
git config --global user.email ${{ secrets.GIT_EMAIL }}
|
||||
git config --global init.defaultBranch main
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true # Checkout private submodules(themes or something else).
|
||||
- name: Setup SSH
|
||||
uses: https://github.com/webfactory/ssh-agent@v0.7.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
- name: Setup Hugo
|
||||
uses: https://github.com/peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
- name: Build
|
||||
run: hugo --minify
|
||||
- name: Add known host
|
||||
run:
|
||||
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
||||
- name: Publish
|
||||
run: |
|
||||
rsync -av --delete public/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.WEB_ROOT }}
|
Reference in a new issue