File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 branches : [development, master, azure]
66
77env :
8- # CURRENT_ENV: ${{ github.ref == 'refs/heads/master' && 'production' || ' development' }}
9- CURRENT_ENV : production
8+ CURRENT_ENV : development
9+ # CURRENT_ENV: ${{ github.ref == 'refs/heads/master' && ' production' || 'development' }}
1010
1111jobs :
1212 build :
13- environment : production
13+ environment : development
14+ # environment: ${{ github.ref == 'refs/heads/master' && 'production' || 'development' }}
1415 name : Build and Deploy
1516 runs-on : ubuntu-latest
1617 steps :
3334 run : |
3435 echo $SERVICE_ACCOUNT_KEY | base64 --decode > serviceAccountKey.json
3536 echo $ENV_FILE | base64 --decode > .env
36- docker build --target production -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} .
37+ docker build --target ${{ env.CURRENT_ENV }} -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }} .
3738 docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }}
3839
3940 - name : Deploy to Azure App Service
Original file line number Diff line number Diff line change @@ -5,10 +5,14 @@ WORKDIR /usr/src/app
55
66COPY package*.json ./
77
8- RUN npm ci
8+ RUN npm i
99
1010COPY . .
1111
12+ EXPOSE 3000
13+
14+ CMD ["npm" , "run" , "start:dev" ]
15+
1216# Production (multi-stage build)
1317FROM node:16-alpine AS build
1418
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments