Skip to content

Merge pull request #147 from redhat123456/main #202

Merge pull request #147 from redhat123456/main

Merge pull request #147 from redhat123456/main #202

Workflow file for this run

name: Deploy to Another Repo with Force Push
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: MY_DEPLOY_TOKEN
steps:
- name: Checkout source repo
uses: actions/checkout@v4
- name: Build project
run: |
npm install
npm run build
- name: Clone target repo
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
git clone --branch main https://x-access-token:${DEPLOY_TOKEN}@github.com/FEMATHS/FEMATHS.github.io.git target-repo
rm -rf target-repo/*
cp -r build/* target-repo/
cd target-repo
git config user.name "redhat123456"
git config user.email "1907065810@qq.com"
git add .
git commit -m "Deploy via GitHub Actions (force push)" || echo "No changes to commit"
git push -f origin main