diff --git a/.github/workflows/jms-build-test.yml b/.github/workflows/jms-build-test.yml index b32fdcc..edc80e8 100644 --- a/.github/workflows/jms-build-test.yml +++ b/.github/workflows/jms-build-test.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abfec51..5bce674 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Gitea Private Key + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Sync to Gitea Repository + run: | + ssh -o StrictHostKeyChecking=no git@gitea.com || 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 }} diff --git a/.github/workflows/sync-gitea.yml b/.github/workflows/sync-gitea.yml new file mode 100644 index 0000000..46a2a3c --- /dev/null +++ b/.github/workflows/sync-gitea.yml @@ -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/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Sync to Gitea Repository + run: | + ssh -o StrictHostKeyChecking=no git@gitea.com || 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 }} \ No newline at end of file diff --git a/VERSION b/VERSION index 992977a..9cb4db9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.1.0 \ No newline at end of file +v1.1.1 \ No newline at end of file