File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .vscode
2+ dist
3+ node_modules
4+ .editorconfig
5+ .env
6+ .env.example
7+ .gitignore
8+ package-lock.json
9+ README.md
Original file line number Diff line number Diff line change 1+ name : Continuos Deployment workflow
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ env :
9+ HEROKU_API_KEY : ${{ secrets.HEROKU_API_KEY }}
10+
11+ jobs :
12+ cd :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v2
17+ - name : Install heroku and login
18+ # Login using HEROKU_API_KEY env variable
19+ run : |
20+ curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
21+ heroku container:login
22+ - name : Build docker image
23+ run : docker build -t registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web .
24+ - name : Deploy docker image
25+ run : docker push registry.heroku.com/${{ secrets.HEROKU_APP_NAME }}/web
26+ - name : Release
27+ run : heroku container:release web -a ${{ secrets.HEROKU_APP_NAME }}
Original file line number Diff line number Diff line change 1+ FROM node:12-alpine AS base
2+ RUN mkdir -p /usr/app
3+ WORKDIR /usr/app
4+
5+ # Build front
6+ FROM base AS build-frontend
7+ COPY ./front ./
8+ RUN npm install
9+ RUN npm run build
10+
11+ # Build backend
12+ FROM base AS build-backend
13+ COPY ./back ./
14+ RUN npm install
15+ RUN npm run build
16+
17+ # Release
18+ FROM base AS release
19+ COPY --from=build-backend /usr/app/dist ./
20+ COPY --from=build-frontend /usr/app/dist ./public
21+ COPY ./back/package.json ./
22+ RUN npm install --only=production
23+
24+ ENTRYPOINT [ "node" , "index" ]
You can’t perform that action at this time.
0 commit comments