Skip to content

init docker

init docker #18

Workflow file for this run

name: production
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
testing:
runs-on: ubuntu-latest
timeout-minutes: 5
# services:
# postgres:
# image: postgres:latest
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: test
# ports:
# - 5432:5432
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Install dependencies
run: cd ./server && npm install
# - name: Run database migrations
# run: cd ./server && npm run migrate:up
# env:
# NODE_ENV: test
# DB_NAME: test
# DB_USER: postgres
# DB_PASSWORD: postgres
# DB_HOST: localhost
# DB_PORT: 5432
# DB_LOGGING: false
- name: Run tests
run: cd ./server && npm run test:ci
env:
NODE_ENV: test
PORT: 5000
SECRET_OR_KEY: test_secret
deploy:
needs: [testing]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./server/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/logger:latest
# - name: Build server
# run: cd ./server && npm install && tsc
# - name: Install dependencies
# run: cd ./client && npm install
# - name: Build
# run: cd ./client && npm run build
# - name: Copy
# run: cd ./client && cp -r build/ ../server/dist
# - name: Deploy
# uses: johnbeynon/[email protected]
# with:
# service-id: ${{ secrets.SERVICE_ID }}
# api-key: ${{ secrets.RENDER_API_KEY }}