Skip to content

πŸ”€ feat: Merge pull request #4 from CAU-MOAPP-2023/chore/1-chore-cicd #1

πŸ”€ feat: Merge pull request #4 from CAU-MOAPP-2023/chore/1-chore-cicd

πŸ”€ feat: Merge pull request #4 from CAU-MOAPP-2023/chore/1-chore-cicd #1

Workflow file for this run

name: Node.js CI
on:
push:
branches: [ "main", "develop" ]
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18.x
- name: Install modules & Build
run: |
npm ci
npm run build --if-present
- name: Run test
run: |
npm test
npm run test:e2e
- name: Docker login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
logout: true
- name: Build and push to DockerHub
run: |
docker build -t ${{ secrets.PROJECT_NAME }} .
docker tag ${{ secrets.PROJECT_NAME }}:latest ${{ secrets.DOCKER_USERNAME }}/${{ secrets.PROJECT_NAME }}:latest
docker push ${{ secrets.DOCKER_USERNAME }}/${{ secrets.PROJECT_NAME }}:latest