forked from Cotya/OpenMage-demo-deployment
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (56 loc) · 2.24 KB
/
deployment-nexcess.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "Deployment Nexcess"
on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Composer Install
uses: php-actions/composer@v6
with:
command: install
args: --working-dir=./src/ --ignore-platform-reqs
- run: cd ./src && bash scripts/removeParts.sh && sudo bash scripts/applyChanges.sh
- run: ls -la ./ ./src
- name: Deploy to server
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.OPENMAGE_DEMO_DEPLOY_RSA }}
ARGS: "-rltgoDzvO"
SOURCE: "src/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ~/github_deploy/build_${{ github.run_number }}
- name: set symlink
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.OPENMAGE_DEMO_DEPLOY_RSA }}
script: cd ~/github_deploy/build_${{ github.run_number }} && rm -rf htdocs/media htdocs/app/etc && ln -nsf $(realpath ../../shared-files/media) htdocs/media && ln -nsf $(realpath ../../shared-files/etc) htdocs/app/etc
- name: clean build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.OPENMAGE_DEMO_DEPLOY_RSA }}
script: cd ~/github_deploy/build_${{ github.run_number }} && bash scripts/removeParts.sh
- name: set symlink
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.OPENMAGE_DEMO_DEPLOY_RSA }}
script: ln -nsf ~/github_deploy/build_${{ github.run_number }}/htdocs ~/github_latest
- name: clean old deployments
continue-on-error: true
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.OPENMAGE_DEMO_DEPLOY_RSA }}
script: cd ~/github_deploy/ && ls -t | tail -n +4 | xargs rm -r --