Skip to content

Commit 1ee8dca

Browse files
committed
ci: archive with github actions
1 parent 3b9c23b commit 1ee8dca

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

.github/workflows/archive.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Archive Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Target Version'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
archive:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout current repository
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
fetch-depth: 0
21+
22+
- name: Setup Git
23+
run: |
24+
git config --global user.name "ng-zorro-bot"
25+
git config --global user.email "ng-zorro-bot@users.noreply.github.com"
26+
27+
- name: Clone ng-zorro.github.io repository
28+
run: |
29+
git clone https://github.com/NG-ZORRO/ng-zorro.github.io.git --depth=1 temp-repo
30+
cd temp-repo
31+
echo "Cloned repository contents:"
32+
ls -la
33+
34+
- name: Remove issue-helper and version folders and hidden files
35+
run: |
36+
cd temp-repo
37+
echo "Removing issue-helper and version folders..."
38+
rm -rf issue-helper
39+
rm -rf version
40+
echo "Removing all hidden files (starting with .)..."
41+
rm -rf .*
42+
echo "Remaining contents after removal:"
43+
ls -la
44+
45+
- name: Create version directory
46+
run: |
47+
mkdir -p version/${{ github.event.inputs.version }}
48+
echo "Created directory: version/${{ github.event.inputs.version }}"
49+
50+
- name: Move files to version directory
51+
run: |
52+
cd temp-repo
53+
find . -maxdepth 1 -type f -exec mv {} ../version/${{ github.event.inputs.version }}/ \;
54+
find . -maxdepth 1 -type d ! -name '.' ! -name '..' ! -name '.git' -exec mv {} ../version/${{ github.event.inputs.version }}/ \;
55+
cd ..
56+
echo "Files moved to version/${{ github.event.inputs.version }}:"
57+
ls -la version/${{ github.event.inputs.version }}/
58+
59+
- name: Clean up temporary repository
60+
run: |
61+
rm -rf temp-repo
62+
63+
- name: Commit and push changes
64+
run: |
65+
git add version/${{ github.event.inputs.version }}/
66+
if git diff --staged --quiet; then
67+
echo "No changes to commit"
68+
else
69+
git commit -m "chore: archive version ${{ github.event.inputs.version }}"
70+
git push origin ${{ github.ref_name }}
71+
echo "Successfully archived version ${{ github.event.inputs.version }}"
72+
fi

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# NG-ZORRO Archive Documentation
2+
3+
This repository serves as an archive for storing build artifacts from previous versions of the ng-zorro-antd official website. It provides a centralized location to preserve historical documentation and examples from different releases of the NG-ZORRO component library.
4+
5+
## Purpose
6+
7+
The ng-zorro-antd project maintains its official documentation website at [https://github.com/NG-ZORRO/ng-zorro.github.io](https://github.com/NG-ZORRO/ng-zorro.github.io). As the project evolves, older versions of the documentation may be updated or replaced. This archive repository ensures that:
8+
9+
- Historical documentation remains accessible
10+
- Developers can reference older API documentation
11+
- Previous examples and demos are preserved
12+
- Version-specific build artifacts are safely stored
13+
14+
## Automated Archiving with GitHub Actions
15+
16+
Use the Github Actions `Archive Version` to automate the archiving process with specific the target version numbers, such as `19.3.x`.

0 commit comments

Comments
 (0)