Skip to content

Build workflow

Build workflow #2128

Workflow file for this run

name: CI
on:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:latest
ports:
- 6000:27017
env:
MONGO_TEST_DB: mongodb://localhost:6000
NODE_ENV: test
MONGO_PROD_DB: 'oe'
concurrency: test_environment
steps:
- uses: actions/checkout@v3
- name: Uses Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- run: npm install
- run: npm run build
- run: npm run test
- name: Build Docker Image
run: |
docker build \
-t my-image:latest \
--build-arg NODE_ENV=production \
--build-arg MONGO_PROD_DB='mongodb+srv://doadmin:[email protected]/devpulse-backend-staging?tls=true&authSource=admin&replicaSet=pulse-prod-db' \
--build-arg ADMIN_EMAIL=${{ secrets.ADMIN_EMAIL }} \
--build-arg ADMIN_PASS=${{ secrets.ADMIN_PASS }} \
--build-arg COORDINATOR_EMAIL=${{ secrets.COORDINATOR_EMAIL }} \
--build-arg COORDINATOR_PASS=${{ secrets.COORDINATOR_PASS }} .
- name: push Docker Image
uses: mr-smithers-excellent/docker-build-push@v6
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}