Secure Pi Post (#75) #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hugo pages | |
on: | |
push: | |
branches: | |
- main # Set a branch to deploy | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Web Repo | |
uses: actions/checkout@v2 | |
with: | |
repository: davidgs/DavidgsWeb | |
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
path: ./DavidgsWeb | |
# - name: Checkout Translate | |
# uses: actions/checkout@v2 | |
# with: | |
# repository: davidgs/Translator | |
# path: ./translate | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.133.0' | |
extended: true | |
# - name: Golang | |
# uses: actions/checkout@master | |
# - name: Setup go | |
# uses: actions/setup-go@v1 | |
# with: | |
# go-version: '1.16.3' | |
# - name: Build Translator | |
# run: cd ./translate; go build translate.go | |
# - name: Create Secret | |
# uses: jsdaniell/[email protected] | |
# with: | |
# name: "./translate/google-secret.json" | |
# json: ${{ secrets.TRANSLATE_SECRET }} | |
# - name: Translate | |
# run: cd ./translate; ./translate ../DavidgsWeb/content/posts/ | |
# - name: ReCommit | |
# uses: stefanzweifel/git-auto-commit-action@v4 | |
# with: | |
# # Optional, but recommended | |
# # Defaults to "Apply automatic changes" | |
# commit_message: Auto-Translations | |
# # branch: main | |
# # file_pattern: index.*.md | |
# repository: ./DavidgsWeb | |
- name: Build | |
run: cd DavidgsWeb; hugo mod get && hugo mod npm pack && npm install && hugo --minify | |
- name: rsync deployments | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzr | |
path: ./DavidgsWeb/public/ | |
remote_path: ${{ secrets.REMOTE_PATH }} | |
remote_host: ${{ secrets.SSH_HOST }} | |
remote_port: ${{ secrets.SSH_PORT }} | |
remote_user: ${{ secrets.SSH_USER }} | |
remote_key: ${{ secrets.WEBSITE_DEPLOY_KEY }} | |
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }} |