File tree Expand file tree Collapse file tree 4 files changed +54
-1
lines changed
Expand file tree Collapse file tree 4 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 11** /node_modules
22** /dist
3- ** /lib
Original file line number Diff line number Diff line change 1+ name : AWS Dev Deployment
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+ - test
8+
9+ permissions :
10+ id-token : write
11+ contents : read
12+
13+ jobs :
14+ build-and-push :
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout Repo
18+ uses : actions/checkout@v4
19+
20+ - name : Set IMAGE_TAG
21+ run : |
22+ if [[ "${{ github.ref_name }}" == "test" ]]; then
23+ echo "IMAGE_TAG=test" >> $GITHUB_ENV
24+ else
25+ echo "IMAGE_TAG=dev" >> $GITHUB_ENV
26+ fi
27+
28+ - name : AWS config
29+ uses : aws-actions/configure-aws-credentials@v3
30+ with :
31+ role-to-assume : ${{ secrets.AWS_DEV_ROLE }}
32+ role-session-name : GithubNGAGeointSession
33+ aws-region : ${{ secrets.AWS_DEV_REGION }}
34+
35+ - name : AWS ECR Login
36+ id : ecr-login
37+ uses : aws-actions/amazon-ecr-login@v2
38+
39+ - name : Build Docker image and push
40+ env :
41+ REGISTRY : ${{ steps.ecr-login.outputs.registry }}
42+ REPOSITORY : " /mage/server"
43+ IMAGE_TAG : ${{ env.IMAGE_TAG }}
44+ run : |
45+ docker build -t $REGISTRY$REPOSITORY:$IMAGE_TAG .
46+ docker push $REGISTRY$REPOSITORY:$IMAGE_TAG
47+
48+ - name : ReDeploy ECS Service
49+ env :
50+ SERVICE : " mage${{ env.IMAGE_TAG }}"
51+ run : |
52+ aws ecs update-service --cluster magedev --service $SERVICE --force-new-deployment
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ node_modules
1010coverage /
1111docker /database /
1212docker /server /resources /
13+ server /resources
1314npm-debug.log
1415pnpm-debug.log
1516scratch /
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ WORKDIR /imageserviceplugin
4444COPY plugins/image/service/package*.json ./
4545RUN npm install
4646COPY --from=build-service /service /imageserviceplugin/node_modules/@ngageoint/mage.service
47+ RUN rm -rf /imageserviceplugin/node_modules/@ngageoint/mage.service/node_modules/mongoose
4748COPY plugins/image/service/ ./
4849RUN npm run build
4950RUN npm pack
You can’t perform that action at this time.
0 commit comments