-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (42 loc) · 1.43 KB
/
pr-previews.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
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'