Engagement Workflow View #475
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
name: PR Previews | |
on: | |
# only trigger when PR is opened, closed, labeled, unlabeled | |
# or synchronized (updated) or when a push is made on the PR branch | |
pull_request: | |
types: | |
- opened | |
- closed | |
- labeled | |
- unlabeled | |
- synchronize | |
jobs: | |
build-and-deploy: | |
if: | | |
contains(github.event.pull_request.labels.*.name, 'preview-it') || | |
( | |
github.event.action == 'unlabeled' && | |
!contains(github.event.pull_request.labels.*.name, 'preview-it') | |
) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Save branch name | |
run: echo "BRANCH=${GITHUB_REF}" >> $GITHUB_ENV | |
- name: Node Setup & Yarn Install | |
uses: ./.github/actions/setup | |
- name: Trigger EKS Build Pipeline | |
uses: ./.github/actions/start-codepipeline | |
if: github.event.action != 'closed' | |
with: | |
aws-region: 'us-east-2' | |
aws-access-key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-key: ${{ secrets.AWS_SECRET_KEY }} | |
pipeline-name: ${{ secrets.AWS_PIPELINE_NAME }} | |
git-branch: ${{ github.event.pull_request.head.ref }} | |
- name: Trigger EKS Deploy Pipeline | |
uses: ./.github/actions/start-codepipeline | |
with: | |
aws-region: 'us-east-2' | |
aws-access-key: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-key: ${{ secrets.AWS_SECRET_KEY }} | |
pipeline-name: 'EKS-Infra' |