From 78251bbcda9a58b18881b45db0ce9849cd01aaf9 Mon Sep 17 00:00:00 2001 From: ITQ Date: Mon, 1 Apr 2024 01:23:12 +0300 Subject: [PATCH] [fix] Fixed CI/CD --- .github/workflows/backend.yml | 10 +--------- .github/workflows/deploy.yml | 9 ++------- .github/workflows/frontend.yml | 25 ++++--------------------- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index ca60d82..5c12f8a 100755 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -53,19 +53,11 @@ jobs: - name: run: cd backend/project && python manage.py test - build_and_push: + test_build: runs-on: ubuntu-latest needs: testing steps: - uses: actions/checkout@v3 - - 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 Docker image run: docker build -t skillhub_backend backend/ - - name: Push Docker image - run: docker push skillhub_backend diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4ffa0b2..a9c2579 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,11 +13,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - name: Pull Docker images and start containers - run: docker-compose up -d + run: | + docker-compose up -d --build diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 4383b23..9a8f261 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -18,28 +18,11 @@ jobs: run: cd frontend && npm run lint continue-on-error: true - build_and_push: + test_build: runs-on: ubuntu-latest 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: cd frontend && npm install - - name: Build - run: cd frontend && 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-backend frontend/ - docker push skillhub-backend + - uses: actions/checkout@v3 + - name: Build Docker image + run: docker build -t skillhub-backend frontend/