This commit is contained in:
1 parent
30502cbd19
commit
aadcd15f99
3 files changed
+57
No files matched your search
@@ -0,0 +1,31 @@
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: build
|
||||
steps:
|
||||
- name: Write CI SSH key
|
||||
env:
|
||||
CI_SSH_KEY: ${{ secrets.CI_SSH_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s\n' "$CI_SSH_KEY" > ~/.ssh/ci_ansible
|
||||
chmod 600 ~/.ssh/ci_ansible
|
||||
|
||||
- name: Deploy to rpi-printserver.local
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=no -i ~/.ssh/ci_ansible randy@rpi-printserver.local '
|
||||
cd /opt/sinatra &&
|
||||
git pull &&
|
||||
$HOME/.rvm/bin/rvm default do bundle install &&
|
||||
sudo systemctl restart sinatra
|
||||
'
|
||||
|
||||
- name: Remove CI SSH key
|
||||
if: always()
|
||||
run: rm -f ~/.ssh/ci_ansible
|
||||
Reference in new issue
Block a user