Add tech report docs #131
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
name: "Mirror to Gitlab" | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
approve: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Approve | |
run: echo All PR should be approved first to prevent any malicious code to be mirrored to the destination. | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [approve] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: deployed | |
fetch-depth: 0 | |
- name: Config git | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git config pull.rebase true | |
- name: Rebase on master | |
run: | | |
git fetch --all | |
git pull --all | |
git checkout master | |
git checkout deployed | |
git rebase master | |
git pull --all | |
git push | |
- name: Revendor dependencies | |
run: sh scripts/revendor.sh | |
- name: Test build | |
run: | | |
cargo install cargo-binutils | |
make all MODE=release | |
- name: Deploy to the branch | |
run: | | |
date > deployment-time.log | |
git add . | |
git commit -m "Deployment" | |
git push | |
mirror: | |
runs-on: ubuntu-latest | |
needs: [deploy] | |
environment: | |
name: Integrate Pull Request | |
env: | |
SRC: "https://github.com/js2xxx/umi.git" | |
DST: "https://PLNTRY:${{ secrets.PASSWORD }}@gitlab.eduxiji.net/PLNTRY/OSKernel2023-umi.git" | |
steps: | |
- name: Clone the source | |
run: git clone --mirror "$SRC" | |
- name: Set remote | |
run: cd `basename "$SRC"` && git remote set-url --push origin "$DST" | |
- name: Fetch remote | |
run: cd `basename "$SRC"` && git fetch -p origin | |
- name: Update branches | |
run: cd `basename "$SRC"` && git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin | |
- name: Push to the destination | |
run: cd `basename "$SRC"` && git push --mirror |