add 1/5 #278
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 | |
# 参考3: Deploy Keysの設定 | |
# https://qiita.com/tamorieeeen/items/c24f8285448b607b12dd | |
# 参考4: お名前ドットコムのレンタルサーバにsshで接続する方法 | |
# https://highfivecreate.com/blog/tips/4943.html | |
# 参考5: appleboy/ssh-action | |
# https://github.com/appleboy/ssh-action | |
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 }} | |
debug: true | |
script: | | |
cd ~/public_html/yusukekato.jp/YusukeKatoBlog/scripts/ | |
git pull origin main | |
bash ./local_update.bash | |
bash ./server_update.bash |