-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (120 loc) · 4.12 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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: Get Composer Cache Directory
id: composer-cache
if: steps.check_files.outputs.files_exists == 'true'
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Set up dependency caching for faster installs
uses: actions/cache@v3
if: steps.check_files.outputs.files_exists == 'true'
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- 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: Get Composer Cache Directory
id: composer-cache
if: steps.check_files.outputs.files_exists == 'true'
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Set up dependency caching for faster installs
uses: actions/cache@v3
if: steps.check_files.outputs.files_exists == 'true'
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- 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: ./