diff --git a/.github/workflows/node.js.release.yml b/.github/workflows/node.js.release.yml index 91ced58c..4282e4f2 100644 --- a/.github/workflows/node.js.release.yml +++ b/.github/workflows/node.js.release.yml @@ -1,8 +1,7 @@ name: Build release site and deploy on: - push: - branches: [ master ] + workflow_dispatch: jobs: build: @@ -24,15 +23,19 @@ jobs: run: sed -i 's/dev-simple.ghostvaibhav.com/ghostvaibhav.com/g' package.json - name: Installing dependencies run: npm install - - name: Setting up Git - run: | - git remote set-url origin https://GhostVaibhav:${{ secrets.PASS }}@github.com/GhostVaibhav/prod-Simple.git - git config --global user.email "48472541+GhostVaibhav@users.noreply.github.com" - git config --global user.name "Vaibhav Sharma" - name: Writing to environment variable run: | touch .env echo 'REACT_APP_RECAPTCHA_KEY=${{ secrets.REACT_APP_RECAPTCHA_KEY }}' >> .env - npm install gh-pages --save-dev - - name: Building and deploying the site - run: npm run deploy + - name: Build the website + run: npm run build + - name: Pushes to another repository + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} + with: + source-directory: 'build' + destination-github-username: 'GhostVaibhav' + destination-repository-name: 'prod-Simple' + user-email: 48472541+GhostVaibhav@users.noreply.github.com + target-branch: main diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index a960fee9..00000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Push to prod - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - environment: github-pages - - strategy: - matrix: - node-version: [16.x] - - steps: - - uses: actions/checkout@v2 - - name: Setting up Git - run: | - git remote set-url origin https://GhostVaibhav:${{ secrets.PASS }}@github.com/GhostVaibhav/prod-Simple.git - git config --global user.email "48472541+GhostVaibhav@users.noreply.github.com" - git config --global user.name "Vaibhav Sharma" - git fetch --prune origin