mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 10:30:17 +01:00
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: Deploy
|
|
run-name: deploy frontned to remote server
|
|
on: [push]
|
|
|
|
jobs:
|
|
copy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Configure SSH
|
|
run: |
|
|
mkdir -p ~/.ssh/
|
|
echo "$SSH_KEY" > ~/.ssh/remote.key
|
|
chmod 600 ~/.ssh/remote.key
|
|
cat >>~/.ssh/config <<END
|
|
Host remote
|
|
HostName $SSH_HOST
|
|
User $SSH_USER
|
|
IdentityFile ~/.ssh/remote.key
|
|
StrictHostKeyChecking no
|
|
env:
|
|
SSH_USER: ${{ secrets.USERNAME }}
|
|
SSH_KEY: ${{ secrets.SSH_KEY }}
|
|
SSH_HOST: ${{ secrets.HOST }}
|
|
- name: Setup rsync
|
|
run: apt-get update && apt-get install rsync -y
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Upload files
|
|
run: rsync -rvp --chown=quentin:users --chmod=777 --exclude=.gitea --exclude=.git ${{ vars.RSYNC_ARGS }} . remote:${{ vars.DESTINATION_DIR }}
|
|
|
|
- name: Run container
|
|
run: ssh remote 'cd ${{ vars.DESTINATION_DIR }} && make run'
|