This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a797a48
commit 7008ca3
Showing
2 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Gitea Private Key | ||
- name: Setup Private Key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
@@ -86,14 +86,27 @@ jobs: | |
applets_version=$(curl -s https://api.github.com/repos/jumpserver/applets/releases/latest | grep "tag_name" | awk '{print $2}' | sed 's/"//g' | sed 's/,//g') | ||
wget -qO opt/download/applets/pip_packages.zip https://github.com/jumpserver/applets/releases/download/${applets_version}/pip_packages.zip | ||
- name: Sync to Gitea Repository | ||
- name: Sync to Repository | ||
run: | | ||
ssh -o StrictHostKeyChecking=no git@gitea.com || echo "" | ||
ssh -o StrictHostKeyChecking=no git@github.com || echo "" | ||
rm -rf .git opt/player || echo "" | ||
git clone --depth=1 git@gitea.com:jumpserver/web-static.git | ||
mv opt/* web-static/ | ||
git clone --depth=1 git@github.com:jumpserver-dev/web-static.git | ||
\cp -rf opt/* web-static/ | ||
cd web-static | ||
git add . | ||
git commit -m "Release Version ${{ steps.get-version.outputs.version }}" | ||
git tag -a ${{ steps.get-version.outputs.version }} -m "Release Version ${{ steps.get-version.outputs.version }}" | ||
git push origin ${{ steps.get-version.outputs.version }} || echo "Tag already exists" | ||
- name: Setup OSSUTIL | ||
uses: yizhoumo/setup-ossutil@v2 | ||
with: | ||
endpoint: ${{ secrets.OSS_ENDPOINT }} | ||
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }} | ||
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} | ||
ossutil-version: '1.7.14' | ||
|
||
- name: Upload Assets to OSS | ||
run: | | ||
ossutil mkdir oss://jms-pkg/jumpserver/web-static/raw/tag/${{ steps.get-version.outputs.version }}/ || echo "Path already exists" | ||
ossutil cp -r opt/ oss://jms-pkg/jumpserver/web-static/raw/tag/${{ steps.get-version.outputs.version }}/ --update |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Sync Gitea Repository | ||
name: Sync Repository | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -29,19 +29,32 @@ jobs: | |
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- name: Setup Gitea Private Key | ||
- name: Setup Private Key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- name: Sync to Gitea Repository | ||
- name: Sync to Repository | ||
run: | | ||
ssh -o StrictHostKeyChecking=no git@gitea.com || echo "" | ||
ssh -o StrictHostKeyChecking=no git@github.com || echo "" | ||
rm -rf .git opt/player || echo "" | ||
git clone --depth=1 git@gitea.com:jumpserver/web-static.git | ||
git clone --depth=1 git@github.com:jumpserver-dev/web-static.git | ||
mv opt/* web-static/ | ||
cd web-static | ||
git add . | ||
git commit -m "Release Version ${{ github.event.inputs.version }}" | ||
git tag -a ${{ github.event.inputs.version }} -m "Release Version ${{ github.event.inputs.version }}" | ||
git push origin ${{ github.event.inputs.version }} --force | ||
git push origin ${{ github.event.inputs.version }} --force | ||
- name: Setup OSSUTIL | ||
uses: yizhoumo/setup-ossutil@v2 | ||
with: | ||
endpoint: ${{ secrets.OSS_ENDPOINT }} | ||
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }} | ||
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} | ||
ossutil-version: '1.7.14' | ||
|
||
- name: Upload Assets to OSS | ||
run: | | ||
ossutil mkdir oss://jms-pkg/jumpserver/web-static/raw/tag/${{ steps.get-version.outputs.version }}/ || echo "Path already exists" | ||
ossutil cp -r opt/ oss://jms-pkg/jumpserver/web-static/raw/tag/${{ steps.get-version.outputs.version }}/ --update |