-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (58 loc) · 2.07 KB
/
deploy-to-demo.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
59
60
# This most likely doesn't work yet
name: Deploy to demo server
on:
push:
tags:
- 'v*'
jobs:
# see https://github.com/marketplace/actions/skip-duplicate-actions
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
paths_ignore: '["**.md"]'
deploy:
runs-on: ubuntu-latest
services:
http_server:
image: cboulanger/docker-phpfarm
options: --name=http_server
volumes:
- /home/runner/work/bibliograph:/github/workspace
steps:
- name: Checkout
uses: actions/[email protected]
- name: Mount workspace dirs into /var/www of http service container
run: docker exec http_server ln -s /github/workspace/bibliograph/{compiled,dist,src,test} /var/www
- name: Setup Node
uses: actions/setup-node@v1
- name: Install Prerequisites
run: tool/env/install
- name: Setup SSH config
run: mkdir ~/.ssh && echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config
- name: Start SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Test connection
run: ssh demo.bibliograph.org
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Deploy
env:
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_ROOT_USER: ${{ secrets.DB_ROOT_USER }}
DB_ROOT_PASSWORD: ${{ secrets.DB_ROOT_PASSWORD }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_TOML: ${{ secrets.DEPLOY_TOML }}
DEPLOY_PARENT_DIR: $${{ secrets.DEPLOY_PARENT_DIR }}
if: "!(github.event.head_commit && contains(github.event.head_commit.message, 'skip deploy'))"
run: .github/workflows/deploy