10月のログを追加 #23
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: cd | |
"on": | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
- name: Build | |
run: hugo --minify | |
- name: Set SSH key | |
run: | | |
mkdir -p ~/.ssh | |
chmod 0700 ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" >~/.ssh/id_rsa | |
chmod 0600 ~/.ssh/id_rsa | |
- name: Add known host | |
run: ssh-keyscan ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy | |
run: | | |
rsync -rlOtcv --delete --checksum -e ssh ./public/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }} |