Last active
February 26, 2024 15:18
-
-
Save ygerasimov/8fa664814d3ec144fa0ddf33cf14d871 to your computer and use it in GitHub Desktop.
pull-request-production-vrt.yml
This file contains hidden or 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
name: Trigger deployment to Test on pull request to Production branch. | |
on: | |
pull_request: | |
branches: | |
- production | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Terminus | |
uses: pantheon-systems/terminus-github-actions@main | |
with: | |
pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }} | |
- name: deployer | |
env: | |
pantheon_repo: '${{ secrets.PANTHEON_REPO }}' | |
pantheon_site_name: '${{ secrets.PANTHEON_SITE_NAME }}' | |
run: | | |
terminus env:deploy $pantheon_site_name.test --note="Test deployment: ${{ github.event.pull_request.title }}" | |
terminus env:clone-content --cc --updatedb $pantheon_site_name.live test --yes | |
- name: Trigger Diffy testing | |
env: | |
diffy_api_key: '${{ secrets.DIFFY_API_KEY }}' | |
diffy_project_id: '${{ secrets.DIFFY_PROJECT_ID }}' | |
run: | | |
# Download Diffy-CLI. | |
wget https://github.com/diffywebsite/diffy-cli/releases/latest/download/diffy.phar | |
# Authenticate. | |
php diffy.phar auth:login $diffy_api_key | |
# Compare with commit sha so Diffy's github check posts the results. | |
php diffy.phar project:compare $diffy_project_id production staging --commit-sha="${{ github.event.pull_request.head.sha }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment