-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.53 KB
/
e2e-tests.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
name: Run e2e Tests
on:
push:
branches: [dev, production]
tags:
- '*.*.*'
pull_request:
branches: [dev]
jobs:
e2e-tests:
runs-on: ubuntu-20.04
container: cypress/browsers:node-20.17.0-chrome-128.0.6613.137-1-ff-130.0.1-edge-128.0.2739.67-1
env:
VITE_ALGOLIA_APP_ID: ${{ secrets.VITE_ALGOLIA_APP_ID }}
VITE_ALGOLIA_API_READ_KEY: ${{ secrets.VITE_ALGOLIA_API_READ_KEY }}
VITE_ALGOLIA_INDEX: ${{ secrets.VITE_ALGOLIA_INDEX }}
VITE_ALGOLIA_INDEX_ALPHABETICAL_REPLICA: ${{ secrets.VITE_ALGOLIA_INDEX_ALPHABETICAL_REPLICA }}
VITE_ALGOLIA_INDEX_LAST_UPDATED_REPLICA: ${{ secrets.VITE_ALGOLIA_INDEX_LAST_UPDATED_REPLICA }}
VITE_USER_NODE_ENV: ${{ secrets.VITE_USER_NODE_ENV }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Debug Env
run: |
echo ${{ secrets.VITE_ALGOLIA_APP_ID }}
echo ${{ secrets.VITE_ALGOLIA_API_READ_KEY }}
echo ${{ secrets.VITE_ALGOLIA_INDEX }}
- uses: marceloprado/has-changed-path@v1.0.1
id: code-changes
with:
paths: src e2e
- name: Run e2e tests
if: steps.code-changes.outputs.changed == 'true'
uses: cypress-io/github-action@v6.6.1
with:
start: npm run dev
wait-on: http://127.0.0.1:3001
browser: chrome
# - name: Deploy to AWS Testing
# uses: zulhfreelancer/aws-codepipeline-action@v1.0.7
# if: github.ref == 'refs/heads/v2'
# with:
# aws-region: "ca-central-1"
# aws-access-key: ${{ secrets.AWS_PIPELINE_ACCESS_KEY }}
# aws-secret-key: ${{ secrets.AWS_PIPELINE_SECRET_KEY }}
# pipeline-name: "v2_pressbooks_directory"
- name: Deploy to AWS Dev
uses: zulhfreelancer/aws-codepipeline-action@v1.0.7
if: github.ref == 'refs/heads/dev'
with:
aws-region: "ca-central-1"
aws-access-key: ${{ secrets.AWS_PIPELINE_ACCESS_KEY }}
aws-secret-key: ${{ secrets.AWS_PIPELINE_SECRET_KEY }}
pipeline-name: "pressbooks-directory-front-end"
- name: Deploy to AWS Production
uses: zulhfreelancer/aws-codepipeline-action@v1.0.7
if: github.ref == 'refs/heads/production'
with:
aws-region: "ca-central-1"
aws-access-key: ${{ secrets.AWS_PIPELINE_PROD_ACCESS_KEY }}
aws-secret-key: ${{ secrets.AWS_PIPELINE_PROD_SECRET_KEY }}
pipeline-name: "pressbooks-directory"