-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (47 loc) · 1.6 KB
/
deploy-staging.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
58
name: Deployment - staging
on:
workflow_dispatch:
push:
branches:
- main
jobs:
deploy-staging:
name: Deploy to staging
runs-on: ubuntu-latest
environment: staging
env:
DATABASE_HOST: localhost
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, iconv, json, mbstring, pdo
- name: Download dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--optimize-autoloader"
- name: Install assets
run: bin/console importmap:install
- name: Build assets (SASS)
run: bin/console sass:build
- name: Compile asset map
run: bin/console asset-map:compile
- name: Deploy files over SSH
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
ARGS: "-rlDzvc -i --delete --exclude-from=rsync-exclude.txt"
SOURCE: "/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.FILES_SENDING_REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
- name: Execute remote ssh commands to finalise deployment
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.POST_DEPLOY_REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: ${{ secrets.DOCKER_COMPOSE_EXEC_COMMAND }} bin/post-deploy