-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
726 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy Websockets for QA | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- .github/workflows/*.yaml | ||
- src/**/*.ts | ||
- Dockerfile.production | ||
- package.json | ||
- package-lock.json | ||
- tools/**/*.js | ||
|
||
jobs: | ||
build: | ||
name: Building a new docker image | ||
runs-on: ubuntu-latest | ||
environment: qa | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
- run: npm install | ||
- run: npm run build | ||
- name: Getting project info | ||
id: project-info | ||
run: node tools/info.js | ||
- name: Build, tag, and push docker image to Amazon ECR | ||
env: | ||
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
IMAGE_TAG: ${{ steps.project-info.outputs.version }} | ||
REPOSITORY: vitruveo.studio.websocket | ||
UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} | ||
UPDATE_URL: ${{ secrets.UPDATE_URL }} | ||
REPOSITORY_IMAGE: ${{ vars.REPOSITORY_IMAGE }} | ||
run: | | ||
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG.qa -f Dockerfile.production --network host . | ||
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG.qa | ||
curl -X "POST" -H 'Content-Type: application/json' -d "{\"token\":\"$UPDATE_TOKEN\",\"image\":\"$REPOSITORY_IMAGE:$IMAGE_TAG.qa\",\"service\":\"vitruveo-studio_websocket\"}" $UPDATE_URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
FROM node:16 | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /app | ||
COPY package*.json /app/ | ||
|
||
RUN npm install | ||
RUN npm set-script prepare "" && \ | ||
npm ci --omit=dev --no-audit --only=production --verbose | ||
|
||
COPY build ./ | ||
COPY entrypoint.sh ./ | ||
|
||
ENTRYPOINT [ "/app/entrypoint.sh" ] | ||
CMD [ "wait" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM node:16 | ||
|
||
ENV NODE_ENV=dev | ||
WORKDIR /app | ||
VOLUME /app | ||
|
||
ENTRYPOINT [ "/app/entrypoint.sh" ] | ||
CMD [ "wait" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:16 | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /app | ||
COPY package*.json /app/ | ||
|
||
RUN npm set-script prepare "" && \ | ||
npm ci --omit=dev --no-audit --only=production --verbose | ||
|
||
COPY build ./ | ||
COPY entrypoint.sh ./ | ||
|
||
ENTRYPOINT [ "/app/entrypoint.sh" ] | ||
CMD [ "wait" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# Introdução | ||
# Introduction | ||
|
||
Template para projetos em typescript | ||
Server websocket | ||
|
||
## Development | ||
|
||
## Desenvolvimento | ||
### Prerequisites | ||
|
||
### Pre-requisitos | ||
To use this project, you will need the following software installed: | ||
|
||
Para utilizar este projeto você precisará ter os seguintes softwares instalados: | ||
- Node.js version 16.x (specific); | ||
- VSCode or Neovim. | ||
|
||
- Docker 19.x ou superior; | ||
- Nodejs versão 16.x (especifica); | ||
- VSCode ou Neovim; | ||
### Environment | ||
|
||
### Ambiente | ||
|
||
Para inicializar o ambiente de desenvolvimento, utilize: | ||
To initialize the development environment, use: | ||
|
||
```sh | ||
npm install | ||
npm start | ||
npm run dev | ||
``` | ||
|
||
### force push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.