From ea48189dae7e6c1a032e2c4c006a5f381d12f889 Mon Sep 17 00:00:00 2001 From: Ananya Gupta <145869907+ananyag309@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:41:37 +0530 Subject: [PATCH] Add files via upload --- .github/ISSUE_TEMPLATE/workflow/ci-cd.yaml | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/workflow/ci-cd.yaml diff --git a/.github/ISSUE_TEMPLATE/workflow/ci-cd.yaml b/.github/ISSUE_TEMPLATE/workflow/ci-cd.yaml new file mode 100644 index 0000000..75a943a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/workflow/ci-cd.yaml @@ -0,0 +1,82 @@ +name: CI/CD Pipeline for Web3-DREAM11 + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' # Specify the Node.js version + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + - name: Build application + run: npm run build # Replace with your build command + + solidity: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Solidity + run: | + sudo apt-get install -y solc + + - name: Compile Solidity contracts + run: | + mkdir build + solc --bin --abi -o build/ contracts/*.sol + + docker: + runs-on: ubuntu-latest + needs: [build, solidity] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docker image + run: | + docker build -t web3-dream11 . + + - name: Push Docker image + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + run: | + echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + docker tag web3-dream11 yourdockerhubusername/web3-dream11:latest + docker push yourdockerhubusername/web3-dream11:latest + + deploy: + runs-on: ubuntu-latest + needs: docker + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Deploy application + run: | + echo "Deploying application..." + # Add your deployment commands here (e.g., using SSH, Kubernetes, etc.)