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

Commit

Permalink
Merge pull request #30 from jumpserver/dev
Browse files Browse the repository at this point in the history
feat: 同步 gitea
  • Loading branch information
wojiushixiaobai authored Apr 11, 2024
2 parents 57535a1 + 89385fe commit 08abd02
Show file tree
Hide file tree
Showing 4 changed files with 67 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
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,20 @@ 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
git clone --depth=1 git@${{ github.repository }}.git
mv opt/* 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 }}
39 changes: 39 additions & 0 deletions .github/workflows/sync-gitea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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
git clone --depth=1 git@${{ github.repository }}.git web-static
mv opt/* 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 08abd02

Please sign in to comment.