-
Notifications
You must be signed in to change notification settings - Fork 14
108 lines (92 loc) · 4.32 KB
/
TestGitHubActions.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: "Test GitHub Actions"
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Test-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd
- uses: actions/checkout@v3
with:
path: drainpipe
- uses: ./drainpipe/scaffold/github/actions/common/set-env
- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: no-reply@example.com
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Setup Project
run: |
ddev config --auto
ddev start
ddev composer config extra.drupal-scaffold.gitignore true
ddev composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
ddev composer config --no-plugins allow-plugins.composer/installers true
ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev composer config minimum-stability dev
ddev composer require lullabot/drainpipe --with-all-dependencies
- name: Install Drupal
run: |
ddev drush site:install minimal -y
echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php
ddev drush config:export -y
- name: Lint GitHub Actions and Workflows
run: ddev task "github:actions:lint directories='./drainpipe/scaffold/github/actions ./drainpipe/scaffold/github/workflows'"
- name: Run Database Updates
run: ddev task update
- name: Create pantheon.yml
run: |
echo "api_version: 1" >> pantheon.yml
echo "web_docroot: true" >> pantheon.yml
echo "php_version: 8.1" >> pantheon.yml
echo "drush_version: 10" >> pantheon.yml
echo "database:" >> pantheon.yml
echo " version: 10.4" >> pantheon.yml
echo "enforce_https: full+subdomains" >> pantheon.yml
echo "build_step: false" >> pantheon.yml
- name: Create .drainpipeignore
run: |
echo "/web/sites/default/files" >> .drainpipeignore
echo "/.ddev" >> .drainpipeignore
echo "settings.ddev.php" >> .drainpipeignore
echo "/drainpipe" >> .drainpipeignore
- name: Create settings.php
run: |
echo '<?php' > web/sites/default/settings.php
echo "\$settings['container_yamls'][] = __DIR__ . '/services.yml';" >> web/sites/default/settings.php
echo "include __DIR__ . \"/settings.pantheon.php\";" >> web/sites/default/settings.php
echo "\$settings['config_sync_directory'] = '../config';" >> web/sites/default/settings.php
curl -o web/sites/default/settings.pantheon.php https://raw.githubusercontent.com/pantheon-systems/drops-8/default/sites/default/settings.pantheon.php
- name: Snapshot Project
env:
directory: /tmp/release
remote:
message:
site:
run: |
echo "/drainpipe" >> .drainpipeignore
ddev task snapshot:directory directory=/tmp/release
- name: Prepare Actions
run: |
mkdir -p .github/actions
cp -R ./drainpipe/scaffold/github/actions/common .github/actions/drainpipe
- name: Deploy Pantheon Review App
uses: ./drainpipe/scaffold/github/actions/pantheon/review
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }}
commit-message: ${{ github.sha }}
site-name: ${{ secrets.PANTHEON_SITE_NAME }}
lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }}
lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }}
# set to "true" if you want to run the installer
run-installer: ${{ secrets.PANTHEON_REVIEW_RUN_INSTALLER }}