From 28b274c603b8228f74aa864abba22815d4bdf547 Mon Sep 17 00:00:00 2001 From: DEVSI SINGH <74105169+emily876@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:10:01 +0530 Subject: [PATCH] Delete .github/workflows directory --- .github/workflows/deloyment.yml | 52 --------------- .github/workflows/nextjs.yml | 93 --------------------------- .github/workflows/testing_nextjs1.yml | 36 ----------- 3 files changed, 181 deletions(-) delete mode 100644 .github/workflows/deloyment.yml delete mode 100644 .github/workflows/nextjs.yml delete mode 100644 .github/workflows/testing_nextjs1.yml diff --git a/.github/workflows/deloyment.yml b/.github/workflows/deloyment.yml deleted file mode 100644 index a473b81..0000000 --- a/.github/workflows/deloyment.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: "Build and Push to GHCR" - -on: - push: - branches: - - main - -jobs: - Deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ secrets.GHCR_USERNAME }} - password: ${{ secrets.GHCR_TOKEN }} - - - name: Build and Push for Frontend Github Registry - if: github.ref == 'refs/heads/main' - env: - DEV_ENV_FILE: ${{ secrets.ENV_FILE }} - run: | - echo "$DEV_ENV_FILE" > .env - export CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr '[:upper:]' '[:lower:]') - export TAG=$([[ $CURRENT_BRANCH == $(basename ${{ github.ref }}) ]] && echo $CURRENT_BRANCH || echo "latest") - echo $TAG - export GITHUB_REF_IMAGE=$(echo ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA | tr '[:upper:]' '[:lower:]') - export GITHUB_BRANCH_IMAGE=$(echo ghcr.io/$GITHUB_REPOSITORY:$TAG | tr '[:upper:]' '[:lower:]') - docker build --build-arg version=$GITHUB_SHA -t $GITHUB_REF_IMAGE -t $GITHUB_BRANCH_IMAGE . - echo "Pushing Frontend Image to GitHub Container Registry" - docker push $GITHUB_REF_IMAGE - docker push $GITHUB_BRANCH_IMAGE - rm -rf .env - - # - name: Deploy on Frontend Dev server - # if: github.ref == 'refs/heads/main' - # uses: appleboy/ssh-action@v0.1.7 - # with: - # host: ${{ secrets.DEV_REMOTE_SERVER_ADDRESS }} - # username: ${{ secrets.DEV_SERVER_USERNAME }} - # key: ${{ secrets.DEV_REMOTE_SERVER_KEY }} - # port: ${{ secrets.DEV_SSH_PORT }} - # script: | - # pwd - # echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin - # docker stop discover && docker rm discover && docker rmi ghcr.io/myriadflow/discover:main - # docker pull ghcr.io/myriadflow/discover:main - # docker run --name="discover" --rm -p 3000:6060 -d ghcr.io/myriadflow/discover:main diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml deleted file mode 100644 index ed74736..0000000 --- a/.github/workflows/nextjs.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Sample workflow for building and deploying a Next.js site to GitHub Pages -# -# To get started with Next.js see: https://nextjs.org/docs/getting-started -# -name: Deploy Next.js site to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Detect package manager - id: detect-package-manager - run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "manager=yarn" >> $GITHUB_OUTPUT - echo "command=install" >> $GITHUB_OUTPUT - echo "runner=yarn" >> $GITHUB_OUTPUT - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "manager=npm" >> $GITHUB_OUTPUT - echo "command=ci" >> $GITHUB_OUTPUT - echo "runner=npx --no-install" >> $GITHUB_OUTPUT - exit 0 - else - echo "Unable to determine package manager" - exit 1 - fi - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: ${{ steps.detect-package-manager.outputs.manager }} - - name: Setup Pages - uses: actions/configure-pages@v5 - with: - # Automatically inject basePath in your Next.js configuration file and disable - # server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). - # - # You may remove this line if you want to manage the configuration yourself. - static_site_generator: next - - name: Restore cache - uses: actions/cache@v4 - with: - path: | - .next/cache - # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - # If source files changed but packages didn't, rebuild from a prior cache. - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - - name: Install dependencies - run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - - name: Build with Next.js - run: ${{ steps.detect-package-manager.outputs.runner }} next build - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: ./out - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/testing_nextjs1.yml b/.github/workflows/testing_nextjs1.yml deleted file mode 100644 index 2183789..0000000 --- a/.github/workflows/testing_nextjs1.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Sample workflow for building and deploying a Next.js site to GitHub Pages -# -# To get started with Next.js see: https://nextjs.org/docs/getting-started -# -name: Next.js CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x, 18.x] # Specify the Node.js versions to test against - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: v18.17.0 - - - name: Install dependencies - run: npm install - - - name: Build Next.js app - run: npm run build