|
1 | | -name: Pan-Afric CI/CD Pipeline |
| 1 | +# name: Pan-Afric CI/CD Pipeline |
2 | 2 |
|
3 | | -on: |
4 | | - pull_request: |
5 | | - branches: [ main ] |
6 | | - push: |
7 | | - branches: [ main ] |
| 3 | +# on: |
| 4 | +# pull_request: |
| 5 | +# branches: [ main ] |
| 6 | +# push: |
| 7 | +# branches: [ main ] |
8 | 8 |
|
9 | | -jobs: |
10 | | - # 1. VALIDATION: Runs on every PR and Push |
11 | | - validate-and-test: |
12 | | - runs-on: ubuntu-latest |
13 | | - steps: |
14 | | - - name: Checkout Code |
15 | | - uses: actions/checkout@v4 |
| 9 | +# jobs: |
| 10 | +# # 1. VALIDATION: Runs on every PR and Push |
| 11 | +# validate-and-test: |
| 12 | +# runs-on: ubuntu-latest |
| 13 | +# steps: |
| 14 | +# - name: Checkout Code |
| 15 | +# uses: actions/checkout@v4 |
16 | 16 |
|
17 | | - - name: Setup Node.js |
18 | | - uses: actions/setup-node@v4 |
19 | | - with: |
20 | | - node-version: '18' |
21 | | - cache: 'npm' |
| 17 | +# - name: Setup Node.js |
| 18 | +# uses: actions/setup-node@v4 |
| 19 | +# with: |
| 20 | +# node-version: '18' |
| 21 | +# cache: 'npm' |
22 | 22 |
|
23 | | - - name: Install Dependencies |
24 | | - run: npm ci |
| 23 | +# - name: Install Dependencies |
| 24 | +# run: npm ci |
25 | 25 |
|
26 | | - - name: Prisma Lint & Generate |
27 | | - run: | |
28 | | - npx prisma generate |
29 | | - npx prisma validate |
| 26 | +# - name: Prisma Lint & Generate |
| 27 | +# run: | |
| 28 | +# npx prisma generate |
| 29 | +# npx prisma validate |
30 | 30 |
|
31 | | - - name: Run Integration Tests |
32 | | - run: npm test |
33 | | - env: |
34 | | - DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }} |
35 | | - EXCHANGE_RATE_API_KEY: ${{ secrets.EXCHANGE_RATE_API_KEY }} |
| 31 | +# - name: Run Integration Tests |
| 32 | +# run: npm test |
| 33 | +# env: |
| 34 | +# DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }} |
| 35 | +# EXCHANGE_RATE_API_KEY: ${{ secrets.EXCHANGE_RATE_API_KEY }} |
36 | 36 |
|
37 | | - # 2. BUILD & PUSH: Only runs when PR is merged to main |
38 | | - build-and-push: |
39 | | - needs: validate-and-test |
40 | | - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
41 | | - runs-on: ubuntu-latest |
42 | | - steps: |
43 | | - - name: Checkout Code |
44 | | - uses: actions/checkout@v4 |
| 37 | +# # 2. BUILD & PUSH: Only runs when PR is merged to main |
| 38 | +# build-and-push: |
| 39 | +# needs: validate-and-test |
| 40 | +# if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 41 | +# runs-on: ubuntu-latest |
| 42 | +# steps: |
| 43 | +# - name: Checkout Code |
| 44 | +# uses: actions/checkout@v4 |
45 | 45 |
|
46 | | - - name: Login to Docker Hub |
47 | | - uses: docker/login-action@v3 |
48 | | - with: |
49 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
50 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 46 | +# - name: Login to Docker Hub |
| 47 | +# uses: docker/login-action@v3 |
| 48 | +# with: |
| 49 | +# username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 50 | +# password: ${{ secrets.DOCKERHUB_TOKEN }} |
51 | 51 |
|
52 | | - - name: Build and Push Docker Image |
53 | | - uses: docker/build-push-action@v5 |
54 | | - with: |
55 | | - context: . |
56 | | - push: true |
57 | | - tags: ${{ secrets.DOCKERHUB_USERNAME }}/pan-afrik-store:latest |
| 52 | +# - name: Build and Push Docker Image |
| 53 | +# uses: docker/build-push-action@v5 |
| 54 | +# with: |
| 55 | +# context: . |
| 56 | +# push: true |
| 57 | +# tags: ${{ secrets.DOCKERHUB_USERNAME }}/pan-afrik-store:latest |
58 | 58 |
|
59 | | - # 3. DEPLOY: Only runs after a successful push to Docker Hub |
60 | | - deploy: |
61 | | - needs: build-and-push |
62 | | - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
63 | | - runs-on: ubuntu-latest |
64 | | - steps: |
65 | | - - name: Deploy via SSH |
66 | | - uses: appleboy/ssh-action@master |
67 | | - with: |
68 | | - host: ${{ secrets.SERVER_IP }} |
69 | | - username: ${{ secrets.SERVER_USER }} |
70 | | - key: ${{ secrets.SSH_PRIVATE_KEY }} |
71 | | - script: | |
72 | | - cd ~/PanAfrik_Store |
73 | | - docker compose pull |
74 | | - docker compose up -d |
| 59 | +# # 3. DEPLOY: Only runs after a successful push to Docker Hub |
| 60 | +# deploy: |
| 61 | +# needs: build-and-push |
| 62 | +# if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 63 | +# runs-on: ubuntu-latest |
| 64 | +# steps: |
| 65 | +# - name: Deploy via SSH |
| 66 | +# uses: appleboy/ssh-action@master |
| 67 | +# with: |
| 68 | +# host: ${{ secrets.SERVER_IP }} |
| 69 | +# username: ${{ secrets.SERVER_USER }} |
| 70 | +# key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 71 | +# script: | |
| 72 | +# cd ~/PanAfrik_Store |
| 73 | +# docker compose pull |
| 74 | +# docker compose up -d |
0 commit comments