-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #535: Use labels to run the Multidev deploy
- Loading branch information
1 parent
8801947
commit ddd39f7
Showing
3 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
scaffold/github/workflows/PantheonReviewAppsDDEVManual.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "Pantheon Review Apps" | ||
|
||
on: | ||
pull_request_target: | ||
types: [ ready_for_review, labeled ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Drainpipe-Deploy-Pantheon-Multidev: | ||
runs-on: ubuntu-22.04 | ||
if: github.event.label.name == 'pantheon-multidev' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/.ddev/.drainpipe-composer-cache | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- uses: ./.github/actions/drainpipe/set-env | ||
|
||
- name: Install and Start DDEV | ||
uses: ./.github/actions/drainpipe/ddev | ||
with: | ||
git-name: Drainpipe Bot | ||
git-email: [email protected] | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | ||
|
||
- name: Build Project | ||
env: | ||
directory: /tmp/release | ||
run: | | ||
ddev composer install | ||
ddev task build | ||
ddev task snapshot:directory directory=/tmp/release | ||
- name: Deploy Pantheon Review App | ||
uses: ./.github/actions/drainpipe/pantheon/review | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} | ||
commit-message: ${{ github.sha }} | ||
site-name: ${{ vars.PANTHEON_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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: "Pantheon Review Apps" | ||
|
||
on: | ||
pull_request_target: | ||
types: [ ready_for_review, labeled ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
# You will also need to add the secrets used below to Dependabot secrets | ||
# if you want this to successfully run in auto-created PRs. | ||
permissions: | ||
deployments: write | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
Drainpipe-Deploy-Pantheon-Multidev: | ||
runs-on: ubuntu-22.04 | ||
if: github.event.label.name == 'pantheon-multidev' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- uses: ./.github/actions/drainpipe/set-env | ||
|
||
- uses: ./.github/actions/drainpipe/setup-git | ||
with: | ||
git-name: Drainpipe Bot | ||
git-email: [email protected] | ||
|
||
- uses: ./.github/actions/drainpipe/setup-ssh | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | ||
|
||
- uses: ./.github/actions/drainpipe/pantheon/setup-terminus | ||
with: | ||
pantheon-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} | ||
terminus-plugins: ${{ vars.TERMINUS_PLUGINS || secrets.TERMINUS_PLUGINS }} | ||
|
||
- uses: php-actions/composer@v6 | ||
|
||
- name: Build Project | ||
env: | ||
directory: /tmp/release | ||
run: | | ||
composer install | ||
task build | ||
task snapshot:directory directory=/tmp/release | ||
- name: Deploy Pantheon Review App | ||
uses: ./.github/actions/drainpipe/pantheon/review | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
terminus-token: ${{ secrets.PANTHEON_TERMINUS_TOKEN }} | ||
commit-message: ${{ github.sha }} | ||
site-name: ${{ vars.PANTHEON_SITE_NAME || secrets.PANTHEON_SITE_NAME }} | ||
lock-username: ${{ secrets.PANTHEON_REVIEW_USERNAME }} | ||
lock-password: ${{ secrets.PANTHEON_REVIEW_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters