From 88a481d8bf1f0c0bcde149e8bf39fe5d4bd103aa Mon Sep 17 00:00:00 2001 From: Issam Mezgueldi Date: Mon, 25 Mar 2024 15:31:25 +0000 Subject: [PATCH] add ci pipeline --- .github/workflows/main.yaml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..a671228 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,43 @@ +name: CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install Dependencies + run: npm install + + - name: Run Tests + run: npm test + + - name: Build and Push Docker image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/iam-fr-edition:latest -f docker/Dockerfile . + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_HUB_TOKEN }} + docker push ${{ secrets.DOCKER_USERNAME }}/iam-fr-edition:latest + + deploy: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Deploy to Production + run: | + # The delpoment script is not implemented yet