From fb35acdb2067c99011f8d92213003b04ef2dfe4e Mon Sep 17 00:00:00 2001 From: mt77 Date: Wed, 13 Aug 2025 22:50:12 +0500 Subject: [PATCH] upd workflow --- .gitea/workflows/build.yml | 32 ++++++ .github/CONTRIBUTING.md | 63 ----------- .github/FUNDING.yml | 1 - .github/ISSUE_TEMPLATE/bug_report.md | 34 ------ .github/ISSUE_TEMPLATE/feature_request.md | 23 ---- .github/SECURITY.md | 14 --- .github/dependabot.yml | 19 ---- .github/workflows/workflow.yml | 121 ---------------------- Dockerfile | 12 ++- Dockerfile.build | 11 -- Dockerfile.old | 5 + 11 files changed, 46 insertions(+), 289 deletions(-) create mode 100644 .gitea/workflows/build.yml delete mode 100644 .github/CONTRIBUTING.md delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/SECURITY.md delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/workflow.yml delete mode 100644 Dockerfile.build create mode 100644 Dockerfile.old diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..8e09ee1 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build Application +on: + push: + tags: + - 'v*.*' + +jobs: + build: + runs-on: large + steps: + + # Шаг 1: Checkout кода + - name: Checkout repository + uses: actions/checkout@v3 + + # Шаг 2: Логин в Docker Registry (Gitea) + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.GIT_INSTANCE }} # Замените на адрес вашего Gitea + username: ${{ secrets.GIT_USERNAME }} + password: ${{ secrets.GIT_TOKEN }} + + # Шаг 3: Сборка и пуш Docker образа + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ./ + push: true + tags: | + ${{ vars.GIT_INSTANCE }}/${{ secrets.GIT_USERNAME }}/${{ vars.REPOSITORY }}:latest + ${{ vars.GIT_INSTANCE }}/${{ secrets.GIT_USERNAME }}/${{ vars.REPOSITORY }}:${{ github.sha }} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index bf61eee..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -# Contribution Guidelines - -Table of Contents: - - - -* [Did you find a bug?](#did-you-find-a-bug) - * [Is it a Security Vulnerability?](#is-it-a-security-vulnerability) - * [Is it already a known issue?](#is-it-already-a-known-issue) - * [Reporting a Bug](#reporting-a-bug) - * [Is there a patch for the bug?](#is-there-a-patch-for-the-bug) -* [Do you want to add a new feature?](#do-you-want-to-add-a-new-feature) - * [Is it just an idea?](#is-it-just-an-idea) - * [Is there a patch for the feature?](#is-there-a-patch-for-the-feature) -* [Do you have questions about the Synapse Admin project or need guidance?](#do-you-have-questions-about-the-synapse-admin-project-or-need-guidance) - - - -## Did you find a bug? - -### Is it a Security Vulnerability? - -Please follow the [Security Policy](https://github.com/etkecc/synapse-admin/blob/main/.github/SECURITY.md) for reporting -security vulnerabilities. - -### Is it already a known issue? - -Please ensure the bug was not already reported by searching [the Issues section](https://github.com/etkecc/synapse-admin/issues). - -### Reporting a Bug - -If you think you have found a bug in Synapse Admin, it is not a security vulnerability, and it is not already reported, -please open [a new issue](https://github.com/etkecc/synapse-admin/issues/new) with: - * A proper title and clear description of the problem. - * As much relevant information as possible: - * The version of Synapse Admin you are using. - * The version of Synapse you are using. - * Any relevant browser console logs, failed requests details, and error messages. - -### Is there a patch for the bug? - -If you already have a patch for the bug, please open a pull request with the patch, -and mention the issue number in the pull request description. - -## Do you want to add a new feature? - -### Is it just an idea? - -Please open [a new issue](https://github.com/etkecc/synapse-admin/issues/new) with: - * A proper title and clear description of the requested feature. - * Any relevant information about the feature: - * Why do you think this feature is needed? - * How do you think it should work? (provide Synapse Admin API endpoint) - * Any relevant screenshots or mockups. - -### Is there a patch for the feature? - -If you already have a patch for the feature, please open a pull request with the patch, -and mention the issue number in the pull request description. - -## Do you have questions about the Synapse Admin project or need guidance? - -Please use the official community Matrix room: [#synapse-admin:etke.cc](https://matrix.to/#/#synapse-admin:etke.cc) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index bce7bfb..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -liberapay: etkecc diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 58ff145..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Report a Synapse Admin bug -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Browser console logs** -If applicable, add the browser console's log - -**Instance configuration:** - - Synapse Admin version: [e.g. v0.10.3-etke39] - - Synapse version [v1.127.1] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index a5c22f6..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for Synapse Admin -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Provide related Synapse Admin API endpoints** -If applicable, provide links to the Synapse Admin API's endpoints that could be used to implement that feature - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index ffba99b..0000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,14 +0,0 @@ -# Security Policy - -## Supported Versions - -Only [the last published version](https://github.com/etkecc/synapse-admin/releases/latest) of the project is supported. -This means that only the latest version will receive security updates. -If you are using an older version, you are strongly encouraged to upgrade to the latest version. - -## Reporting a Vulnerability - -Please contact us using the [#synapse-admin:etke.cc](https://matrix.to/#/#synapse-admin:etke.cc) Matrix room. -The Synapse Admin project is a static JS UI for the Synapse server, -so it is unlikely that there are (or will be) any impactful security vulnerabilities in the project itself. -However, we do not rule out the possibility of such cases, so we will be happy to receive any reports! diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index b263298..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 30 - - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 30 - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 30 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml deleted file mode 100644 index 7801df8..0000000 --- a/.github/workflows/workflow.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: CI -on: - push: - branches: [ "main" ] - tags: [ "v*" ] -env: - bunny_version: v0.1.0 - base_path: ./ -permissions: - checks: write - contents: write - packages: write - pull-requests: read -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: yarn - - name: Install dependencies - run: yarn install --immutable --network-timeout=300000 - - name: Build - run: yarn build --base=${{ env.base_path }} - - uses: actions/upload-artifact@v4 - with: - path: dist/ - name: dist - if-no-files-found: error - retention-days: 1 - compression-level: 0 - overwrite: true - include-hidden-files: true - - docker: - name: Docker - needs: build - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v5 - with: - name: dist - path: dist/ - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - - name: Login to ghcr.io - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Login to hub.docker.com - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 - with: - username: etkecc - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 - with: - images: | - ${{ github.repository }} - ghcr.io/${{ github.repository }} - registry.etke.cc/${{ github.repository }} - tags: | - type=raw,value=latest,enable=${{ github.ref_name == 'main' }} - type=semver,pattern={{raw}} - - name: Build and push - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 - with: - platforms: linux/amd64,linux/arm64 - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - cdn: - name: CDN - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v5 - with: - name: dist - path: dist/ - - name: Upload - run: | - wget -O bunny-upload.tar.gz https://github.com/etkecc/bunny-upload/releases/download/${{ env.bunny_version }}/bunny-upload_Linux_x86_64.tar.gz - tar -xzf bunny-upload.tar.gz - echo "${{ secrets.BUNNY_CONFIG }}" > bunny-config.yaml - ./bunny-upload -c bunny-config.yaml - - github-release: - name: Github Release - needs: build - if: ${{ startsWith(github.ref, 'refs/tags/') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/download-artifact@v5 - with: - name: dist - path: dist/ - - name: Prepare release - run: | - mv dist synapse-admin - tar chvzf synapse-admin.tar.gz synapse-admin - - uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2 - with: - files: synapse-admin.tar.gz - generate_release_notes: true - make_latest: "true" - draft: false - prerelease: false diff --git a/Dockerfile b/Dockerfile index 36eeea7..d957460 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ +FROM node:lts AS builder +ARG BASE_PATH=./ +WORKDIR /src +COPY . /src +RUN yarn config set enableTelemetry 0 && \ + yarn install --immutable --network-timeout=300000 && \ + yarn build --base=$BASE_PATH + FROM ghcr.io/static-web-server/static-web-server:2 - ENV SERVER_ROOT=/app - -COPY ./dist /app +COPY --from=builder /src/dist /app diff --git a/Dockerfile.build b/Dockerfile.build deleted file mode 100644 index d957460..0000000 --- a/Dockerfile.build +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:lts AS builder -ARG BASE_PATH=./ -WORKDIR /src -COPY . /src -RUN yarn config set enableTelemetry 0 && \ - yarn install --immutable --network-timeout=300000 && \ - yarn build --base=$BASE_PATH - -FROM ghcr.io/static-web-server/static-web-server:2 -ENV SERVER_ROOT=/app -COPY --from=builder /src/dist /app diff --git a/Dockerfile.old b/Dockerfile.old new file mode 100644 index 0000000..36eeea7 --- /dev/null +++ b/Dockerfile.old @@ -0,0 +1,5 @@ +FROM ghcr.io/static-web-server/static-web-server:2 + +ENV SERVER_ROOT=/app + +COPY ./dist /app