ci: add manual deploy workflow
This commit is contained in:
1 parent
ebe7dc82d1
commit
c63bac45eb
1 file changed
+36
@@ -0,0 +1,36 @@
|
||||
name: deploy
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Show toolchain
|
||||
run: node -v && npm -v
|
||||
|
||||
- name: Install deploy tools
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends rsync openssh-client
|
||||
|
||||
- name: Configure SSH
|
||||
env:
|
||||
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
MX_HOST_KEY: ${{ secrets.MX_HOST_KEY }}
|
||||
run: |
|
||||
install -m 700 -d ~/.ssh
|
||||
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
|
||||
printf '%s\n' "$MX_HOST_KEY" > ~/.ssh/known_hosts
|
||||
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
set -euo pipefail
|
||||
REL="$(date -u +%Y%m%dT%H%M%SZ)-$(printf %s "$GITHUB_SHA" | cut -c1-7)"
|
||||
rsync -a --exclude=.git --exclude=tests \
|
||||
--link-dest=/var/www/simtrace/current \
|
||||
frontend/ deploy@10.8.0.1:/var/www/simtrace/releases/"$REL"/
|
||||
ssh deploy@10.8.0.1 "deploy-site simtrace $REL"
|
||||
Reference in new issue
Block a user