鍵の設定を更新 #4
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
# 参考1: GitHub Actionsの設定方法 | |
# https://qiita.com/caesar2015/items/139da7e6eacd72b030c8 | |
# 参考2: レンタルサーバにsshする方法 | |
# https://qiita.com/numatti9361/items/5391546e1ef2306517f7 | |
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ssh and deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST_YUSUKEKATOJP }} | |
username: ${{ secrets.SSH_USERNAME_YUSUKEKATOJP }} | |
key: ${{ secrets.SSH_PRIVATE_KEY_YUSUKEKATOJP }} | |
port: ${{ secrets.SSH_PORT_YUSUKEKATOJP }} | |
passphrase: ${{ secrets.SSH_PASSPHRASE_YUSUKEKATOJP }} | |
debug: true | |
script: | | |
cd ~/public_html/yusukekato.jp/YusukeKatoBlog/ | |
git checkout main | |
git pull origin main | |
cd scripts/ | |
bash ./server_update.bash |