.github/workflows/repo-sync.yml #1958
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: .github/workflows/repo-sync.yml | |
on: | |
push: | |
branches: | |
- chinese | |
schedule: | |
- cron: '30 5,18 * * *' | |
workflow_dispatch: | |
jobs: | |
repo-sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout branch chinesepod" | |
uses: actions/checkout@v3 | |
with: | |
ref: chinesepod | |
- name: "Repo-sync branch chinesepod" | |
uses: repo-sync/github-sync@v2 | |
with: | |
source_repo: "https://github.com/maphe/maphe.github.io.git" | |
source_branch: master | |
destination_branch: chinesepod | |
github_token: ${{ secrets.PAT }} | |
- name: "Patch-frontend branch chinese" | |
run: | | |
git reset --hard origin/chinesepod | |
git config --global user.email ${{ secrets.EMAIL }} | |
git config --global user.name ${{ secrets.USERNAME }} | |
git config --global user.password ${{ secrets.PAT }} | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css#https://cdnjs.loli.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.min.css#https://cdnjs.loli.net/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/css/flag-icon.min.css#https://cdnjs.loli.net/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css#https://cdnjs.loli.net/ajax/libs/font-awesome/5.13.1/css/all.min.css#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js#https://cdnjs.loli.net/ajax/libs/jquery/3.5.1/jquery.min.js#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js#https://cdnjs.loli.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap-select.min.js#https://cdnjs.loli.net/ajax/libs/bootstrap-select/1.13.18/js/bootstrap-select.min.js#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/all.min.js#https://cdnjs.loli.net/ajax/libs/font-awesome/5.13.1/js/all.min.js#g' {} \; | |
find ./ -type f -exec sed -i -e 's#https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js#https://cdnjs.loli.net/ajax/libs/popper.js/1.16.1/umd/popper.min.js#g' {} \; | |
find ./ -type f -exec sed -i -e 's#<script async src="https://www.googletagmanager.com/gtag/js?id=G-VBQ8W4W1QK"></script>#<script async src="https://um.iwarship.cn/shipdata" data-website-id="efff22b9-1357-451e-a179-86f67e00764e"></script>#g' {} \; | |
git add ./* | |
git commit -m "Patch frontend urls" | |
git push | |