-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
91 lines (80 loc) · 2.57 KB
/
action.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
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
name: 'Lando Start'
description: 'Spin up oit website'
inputs:
GH_TOKEN_REPO:
description: "PAT"
required: true
GITHUB_TOKEN:
description: "Github token"
required: true
LANDO_ENV:
description: ".env variables"
required: true
CONFIG_SYNC:
description: "Set to 0 to skip a config import"
required: true
DATABASE:
description: "Use specific backup"
required: false
permissions:
contents: read
runs:
using: "composite"
steps:
- name: Custom DATABASE
run: echo "DATABASE=$( $DATABASE )" >> $GITHUB_ENV
env:
database: ${{ inputs.DATABASE }}
shell: bash
- name: Set lando version.
run: echo "LANDO_VERSION=$(cat .github/lando_version.md)" >> $GITHUB_ENV
shell: bash
- name: Install Lando
continue-on-error: true
run: |
echo 'docker compose --compatibility "$@"' > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-$LANDO_VERSION"
sudo chmod +x /usr/local/bin/lando
lando version
shell: bash
- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
shell: bash
- name: Composer install
run: |
composer config -g github-oauth.github.com $gh_token
composer install --ignore-platform-reqs --prefer-dist -n
shell: bash
env:
gh_token: ${{ inputs.GH_TOKEN_REPO }}
- name: Last Sunday date
run: echo "LAST_SUNDAY=$(date -d "last Sunday" +%Y-%m-%d)" >> $GITHUB_ENV
shell: bash
- name: Todays date
run: echo "DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
shell: bash
- name: Spin up site
run: |
echo "$lando_env" > .env
echo "GITHUB_TOKEN=$GITHUB_TOKEN" >> .env
vendor/bin/robo landosetup $gh_token $config_sync
ls docroot/sites/default/settings/
shell: bash
env:
gh_token: ${{ inputs.GH_TOKEN_REPO }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
lando_env: ${{ inputs.LANDO_ENV }}
config_sync: ${{ inputs.CONFIG_SYNC }}
- name: Custom Database
if: "${{ env.DATABASE != '' }}"
run: |
rm backups/site.sql.gz
wget -O backups/site.sql.gz '$DATABASE'
lando db-import backups/site.sql.gz
lando drush sql-sanitize --sanitize-password -y
chmod u+x .keys/createTestUsers.sh
lando ssh -c /app/.keys/createTestUsers.sh
lando drush en oit_dev
lando drush en dblog devel devel_kint_extras
shell: bash