update CI/CD #15
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
name: Docker CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag arcorocr-frontend --no-cache | |
- name: Kill all containers | |
run: if [ $(docker ps -a | wc -l) -gt 1 ]; then docker ps -aq | xargs docker stop | xargs docker rm; fi | |
continue-on-error: true | |
- name: Deploy the Docker image 1 | |
run: docker run -d --restart unless-stopped -p 3000:3000 arcorocr-frontend | |
- name: Deploy the Docker image 2 | |
run: docker run -d --restart unless-stopped -p 3001:3000 arcorocr-frontend | |