-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (69 loc) · 2.33 KB
/
ci.yml
File metadata and controls
75 lines (69 loc) · 2.33 KB
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
73
74
75
name: CI
on:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
upstream-version:
description: Upstream aws-cdk version to use in tests
required: false
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Build and Lint
run: |
npm install
npm run lint
- name: Install AWS CLI
uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install awscli
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id "AKIAI44QH8DHBEXAMPLE" --profile default
aws configure set aws_secret_access_key "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY" --profile default
aws configure set region "us-east-1" --profile default
aws configure set output "json" --profile default
- name: Install Amplify CLI
run: npm install -g @aws-amplify/cli
- name: Set up Amplify Plugin
run: |
npm -g install .
amplify plugin scan
- name: Install Localstack
run: pip install localstack
- name: Start and wait for localstack
timeout-minutes: 5
run: |
docker pull localstack/localstack-pro:latest
LOCALSTACK_API_KEY=${{ secrets.LOCALSTACK_API_KEY }} DEBUG=1 localstack start -d
localstack wait -t 30
- name: Init Amplify Project
run: |
mkdir test_project
cd test_project
amplify init --envName test --yes --use-localstack true
- name: Add Auth Resource
working-directory: test_project
run: |
cat ../headlessRequests/addAuth.json | jq -c | amplify add auth --headless
- name: Add Storage Resource
working-directory: test_project
run: |
cat ../headlessRequests/addStorage.json | jq -c | amplify add storage --headless
- name: Add Api Resource
working-directory: test_project
run: |
cat ../headlessRequests/addApi.json | jq -c | amplify add api --headless
- name: Push Resources
working-directory: test_project
run: amplify push --use-localstack true --yes