Add basic docker container for front-end. #3
Workflow file for this run
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: Generate Docker Containers | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
backend: | |
name: Build backend image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image | |
working-directory: backend | |
run: docker build -t daemontus/bbm-backend . | |
- name: Push image | |
working-directory: backend | |
run: docker push daemontus/bbm-backend | |
frontend: | |
name: Build frontend image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Add Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
working-directory: frontend | |
run: npm install | |
- name: Build frontend | |
working-directory: frontend | |
run: npm run build | |
- name: Build image | |
working-directory: frontend | |
run: docker build -t daemontus/bbn-frontend . | |
- name: Push image | |
working-directory: frontend | |
run: docker push daemontus/bbm-frontend |