diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 8fa91ac..9c7320f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -76,8 +76,8 @@ jobs: SUPABASE_URL: ${{ secrets.SUPABASE_URL }} SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} - deploy: - name: Deploy to Production + build-and-push: + name: Build and push to Docker Hub runs-on: ubuntu-latest needs: test if: github.ref == 'refs/heads/main' @@ -86,14 +86,19 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 with: - node-version: "20" - cache: "npm" + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} - - name: Install dependencies - run: npm ci --omit=dev + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_USERNAME }}/notifierapi:latest - - name: Deploy to Production - run: echo "Deploying to production..." + - name: Deployed to Docker Hub + run: echo "Deployed to Docker Hub"