-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
70 lines (59 loc) · 1.21 KB
/
.gitlab-ci.yml
File metadata and controls
70 lines (59 loc) · 1.21 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
stages:
- build
- deploy
include:
- local: gitlab-ci-template.yml
default:
image: public.ecr.aws/sam/build-nodejs22.x:latest
tags:
- dind-amd64-linux
id_tokens:
GITLAB_OIDC_TOKEN:
aud: https://gitlab.scania.com
retry: 1
variables:
REGION: "eu-north-1"
PROFILE_NAME: "amplify-deploy"
before_script:
- npm install -g @aws-amplify/cli@latest
- !reference [.assume_role]
build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 hour
only:
- main
- develop
deploy_backend:
stage: deploy
script:
- npx ampx configure --yes --profile ${PROFILE_NAME}
- npx ampx sandbox deploy --name ${CI_COMMIT_REF_SLUG} --profile ${PROFILE_NAME}
- npx ampx generate outputs --branch ${CI_COMMIT_REF_SLUG}
artifacts:
paths:
- amplify_outputs.json
expire_in: 1 hour
environment:
name: ${CI_COMMIT_REF_SLUG}
only:
- main
- develop
deploy_frontend:
stage: deploy
dependencies:
- build
- deploy_backend
script:
- npm install -g @aws-amplify/cli
- amplify publish --yes --profile ${PROFILE_NAME}
environment:
name: ${CI_COMMIT_REF_SLUG}
only:
- main
- develop