-
Notifications
You must be signed in to change notification settings - Fork 2
111 lines (94 loc) · 2.97 KB
/
default.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Deploy spenden.epicenter.works
on:
push:
branches:
- master
- new
workflow_dispatch:
env:
PHP_VERSION: '8.1'
permissions:
contents: read
pages: write
id-token: write
defaults:
run:
shell: bash
jobs:
# Deployment job
deploy-stage:
name: 🎉 Deploy stage
environment:
name: stage
url: https://stage.spenden.epicenter.works
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@7c0b4c8c8ebed23eca9ec2802474895d105b11bc
with:
php-version: ${{ env.PHP_VERSION }}
- name: Check if composer.json exists
id: check_files
uses: andstor/file-existence-action@87d74d4732ddb824259d80c8a508c0124bf1c673
with:
files: 'composer.json'
- name: Run composer install if composer.json exists
if: steps.check_files.outputs.files_exists == 'true'
run: |
composer validate --no-check-publish && composer install --prefer-dist --no-progress --ignore-platform-reqs
rm shell.nix
rm -rf nixfiles
- name: Deploy
uses: up9cloud/action-rsync@master
env:
HOST: webhost.epicenter.works
KEY: ${{secrets.SSH_KEY}}
TARGET: /home/stage.spenden.epicenter.works/public_html/
VERBOSE: true
USER: stage.spenden.epicenter.works
ARGS: -a --exclude=/.git/ --exclude=/.github/ --exclude=/.env --delete --no-perms --no-owner --no-group
SOURCE: ./
# Deployment job
deploy-production:
name: 🎉 Deploy production
environment:
name: production
url: https://spenden.epicenter.works
runs-on: self-hosted
needs: deploy-stage
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@7c0b4c8c8ebed23eca9ec2802474895d105b11bc
with:
php-version: ${{ env.PHP_VERSION }}
- name: Check if composer.json exists
id: check_files
uses: andstor/file-existence-action@87d74d4732ddb824259d80c8a508c0124bf1c673
with:
files: 'composer.json'
- name: Run composer install if composer.json exists
if: steps.check_files.outputs.files_exists == 'true'
run: |
composer validate --no-check-publish && composer install --prefer-dist --no-progress --ignore-platform-reqs
rm shell.nix
rm -rf nixfiles
- name: Deploy
uses: up9cloud/action-rsync@master
env:
HOST: webhost.epicenter.works
KEY: ${{secrets.SSH_KEY}}
TARGET: /home/spenden/public_html/
VERBOSE: true
USER: spenden
ARGS: -a --exclude=/.git/ --exclude=/.github/ --exclude=/.env --delete --no-perms --no-owner --no-group
SOURCE: ./