Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
feat: 同步 gitea
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Apr 11, 2024
1 parent 57535a1 commit 1c7999f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 7 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/jms-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- name: Prepare files
run: |
bash prepare.sh
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: false
tags: jumpserver/web-static:test
build-args: |
APT_MIRROR=http://deb.debian.org
file: Dockerfile
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max
19 changes: 18 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,21 @@ jobs:
run: |
gh release create ${{ steps.get-version.outputs.version }} --notes "Release ${{ steps.get-version.outputs.version }}" || echo "Release already exists"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Gitea Private Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Sync to Gitea Repository
run: |
ssh -o StrictHostKeyChecking=no [email protected] || echo ""
rm -rf .git || echo ""
git clone --depth=1 [email protected]:jumpserver/web-static.git
mv 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 }}
40 changes: 40 additions & 0 deletions .github/workflows/sync-gitea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Sync Gitea Repository

on:
workflow_dispatch:
inputs:
version:
description: 'Build Version'
required: true
default: 'v1.1.1'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Prepare files
run: |
bash prepare.sh
- name: Setup Gitea Private Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Sync to Gitea Repository
run: |
ssh -o StrictHostKeyChecking=no [email protected] || echo ""
rm -rf .git || echo ""
git clone --depth=1 [email protected]:jumpserver/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 }}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.0
v1.1.1

0 comments on commit 1c7999f

Please sign in to comment.