Skip to content

Commit

Permalink
feat: update workflows
Browse files Browse the repository at this point in the history
更新工作流使用迁移后的组织名

Log:
  • Loading branch information
myml authored and dengbo11 committed Jul 4, 2024
1 parent f765bfa commit 085eaf7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 57 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: Deploy to GitHub Pages
on:
push:
branches: ['master']
branches: ["master"]
pull_request:
branches: ['master']
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.5.0'] # 定义版本数组
version: ["1.5.0"] # 定义版本数组
steps:
- uses: actions/checkout@v3
- name: Checkout linglong ${{ matrix.version }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.version }} # 使用矩阵中的版本号作为检出的ref
path: ${{ matrix.version }} # 每个版本检出到不同的目录
repository: linuxdeepin/linglong
repository: OpenAtomFoundation/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
- name: Checkout linglong release
uses: actions/checkout@v4
with:
ref: aef466bd48eb714e5376c064459dbe2ca117e115 # 指定玲珑项目的 commit 提交,可能文档有小部分修改,不需要从 tag 获取
path: tmp
repository: linuxdeepin/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
ref: 90f0846d2e9b0ed14e6f51e40c3a25b5de35dd93 # 指定玲珑项目的 commit 提交,可能文档有小部分修改,不需要从 tag 获取
path: tmp
repository: OpenAtomFoundation/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
- name: set release version
run: |
rm -rf en guide
mv tmp/docs/pages/guide .
mv tmp/docs/pages/en .
rm -rf en guide
mv tmp/docs/pages/guide .
mv tmp/docs/pages/en .
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
cache: "yarn"
- name: Install Depend
run: yarn install
- name: Build Pages
Expand Down
79 changes: 37 additions & 42 deletions .github/workflows/sync-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,40 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout linglong pages
uses: actions/checkout@v4
with:
path: linglong
repository: linuxdeepin/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false

- name: checkout self
uses: actions/checkout@v4
with:
path: self
sparse-checkout: |
en
guide
sparse-checkout-cone-mode: false

- name: get diff
run: |
diff -Naur self linglong/docs/pages &> changed.txt || true
if [ ! -s changed.txt ]; then
echo "No docs have been changed, terminate normally."
exit 0
fi
cp -r linglong/docs/pages/en/* self/en/
cp -r linglong/docs/pages/guide/* self/guide/
- name: create pr
uses: peter-evans/create-pull-request@v6
with:
path: self
commit-message: "sync docs automatically."
title: "Sync docs from linglong"
delete-branch: true





- name: checkout linglong pages
uses: actions/checkout@v4
with:
path: linglong
repository: OpenAtomFoundation/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false

- name: checkout self
uses: actions/checkout@v4
with:
path: self
sparse-checkout: |
en
guide
sparse-checkout-cone-mode: false

- name: get diff
run: |
diff -Naur self linglong/docs/pages &> changed.txt || true
if [ ! -s changed.txt ]; then
echo "No docs have been changed, terminate normally."
exit 0
fi
cp -r linglong/docs/pages/en/* self/en/
cp -r linglong/docs/pages/guide/* self/guide/
- name: create pr
uses: peter-evans/create-pull-request@v6
with:
path: self
commit-message: "sync docs automatically."
title: "Sync docs from linglong"
delete-branch: true

0 comments on commit 085eaf7

Please sign in to comment.