-
Notifications
You must be signed in to change notification settings - Fork 3
31 lines (29 loc) · 1.18 KB
/
prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: release
on: workflow_dispatch
jobs:
deploy-prod:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
workflow_conclusion: success
name: project
- name: UnTar project files
run: tar -xzvf project.tar.gz
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DROPLET_KEY }}
known_hosts: ${{ secrets.DROPLET_HOST }}
- name: Deploy with rsync
run: |
rsync -zhrl -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' app/ $SSH_USER@$SSH_HOST:$PROJECT_PATH/app/
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SSH_USER@$SSH_HOST "php $PROJECT_PATH/app/console/yii.php migrate --interactive=0 --migrationPath=@yii/rbac/migrations,@app/migrations"
env:
SSH_USER: ${{ secrets.DROPLET_USER }}
SSH_HOST: ${{ secrets.DROPLET_HOST }}
PROJECT_PATH: ${{ secrets.DROPLET_CMS_PROD_PATH }}
DROPLET_ENV: ${{ secrets.DROPLET_CMS_PROD_DOTENV_BASE64 }}