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 b3b4df2
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 10 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
22 changes: 18 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ name: Checkout and Create Release Version
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -69,4 +66,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 }} || echo "Tag already exists"
42 changes: 42 additions & 0 deletions .github/workflows/sync-gitea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Sync Gitea Repository

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Prepare files
run: |
bash prepare.sh
- name: Set git config
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- 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 }} --force
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 b3b4df2

Please sign in to comment.