[feat] Added properly CI/CD

This commit is contained in:
ITQ
2024-04-01 00:06:23 +03:00
parent bf715ceb02
commit bc5d31e64a
3 changed files with 103 additions and 17 deletions
+44
View File
@@ -0,0 +1,44 @@
name: Frontend CI/CD
on: [push, pull_request]
jobs:
linting:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Linting
run: npm run lint
build_and_push:
runs-on: self-hosted
needs: linting
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker image
run: |
docker build -t skillhub/frontend frontend/
docker push skillhub/frontend