Skip to content

Commit

Permalink
Merge pull request #42 from li-sense/mfe-dev
Browse files Browse the repository at this point in the history
Mfe dev
  • Loading branch information
antonioarieiro authored Nov 7, 2022
2 parents 3d4c9f2 + 19929a8 commit 1796581
Show file tree
Hide file tree
Showing 43 changed files with 17,713 additions and 473 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/cd-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CD-development

on:
pull_request:
branches: [ "mfe-dev" ]

jobs:
Build-and-Test-on-Nodejs:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 16.x, 18.x ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: |
npm install husky --save-dev
npm ci
npm run build --if-present
npm test
Image-to-DockerHub:
needs: Build-and-Test-on-Nodejs

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/front.li-sense:development
53 changes: 53 additions & 0 deletions .github/workflows/cd-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CD-production

on:
pull_request:
branches: [ "mfe-homol" ]

jobs:
Build-and-Test-on-Nodejs:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 16.x, 18.x ]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: |
npm install husky --save-dev
npm ci
npm run build --if-present
npm test
Image-to-DockerHub:
needs: Build-and-Test-on-Nodejs

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/front.li-sense:production
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# === CONFIGURE === #
FROM node:16-alpine
WORKDIR /app
COPY . .

# === BUILD === #
RUN npm install husky --save-dev
RUN npm ci
RUN npm run build

# === RUN === #
ENV NODE_ENV homologation
EXPOSE 3000
CMD [ "npx", "serve", "build" ]
Loading

1 comment on commit 1796581

@antonioarieiro
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S03 RELEASE

Please sign in to comment.