This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
Add repository archived message #121
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: CI/CD | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-frontend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
env: | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
working-directory: frontend | |
run: npm install | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
- name: Build and push docker image | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./frontend | |
file: ./frontend/Dockerfile | |
push: true | |
#Change this to whatever your repository is called | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/capstone-project-frontend:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
build-backend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
env: | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
working-directory: backend | |
run: npm install | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
- name: Build and push docker image | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./backend | |
file: ./backend/Dockerfile | |
push: true | |
#Change this to whatever your repository is called | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/capstone-project-backend:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |