Skip to content

deploy-website

deploy-website #59

name: deploy-website
on:
push:
branches: [ master ]
paths-ignore:
- '.git**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.SSH_PRIVATE_KEY }}"
name: id_ed25519
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Checkout website
uses: actions/checkout@master
with:
path: exult-web-master
- name: Upload and update website
shell: bash
run: |
cd $GITHUB_WORKSPACE
zip -9 master.zip -r exult-web-master
scp -i ~/.ssh/id_ed25519 master.zip ${{ secrets.SCP_HOST }}:${{ secrets.PROJECT_HOME }}
ssh -i ~/.ssh/id_ed25519 ${{ secrets.SSH_HOST }} create
ssh -t -i ~/.ssh/id_ed25519 ${{ secrets.SSH_HOST }} "cd ${{ secrets.PROJECT_HOME }}; ./update.sh"
ssh -i ~/.ssh/id_ed25519 ${{ secrets.SSH_HOST }} shutdown