From 0c221bcc351801107cc24a28f420a62c89104894 Mon Sep 17 00:00:00 2001 From: Aine Date: Tue, 20 Aug 2024 16:40:14 +0300 Subject: [PATCH] migrate to github --- .github/FUNDING.yml | 1 + .github/workflows/workflow.yml | 53 ++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 24 --------------- README.md | 4 --- 4 files changed, 54 insertions(+), 28 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/workflow.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bce7bfb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +liberapay: etkecc diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..b3afde1 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,53 @@ +name: +on: + push: + branches: [ "main" ] +env: + app_version: 2.2.2 + app_plugins: ep_font_size ep_font_family ep_font_color ep_spellcheck ep_table_of_contents ep_subscript_and_superscript ep_mammoth ep_print ep_comments_page ep_embedded_hyperlinks2 ep_adminpads2 ep_align ep_headings2 ep_cursortrace ep_markdown ep_set_title_on_pad ep_embedmedia ep_themes ep_rewrite_share_paths +permissions: + checks: write + contents: write + packages: write + pull-requests: read +jobs: + build-publish: + name: Build and Publish + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + registry.etke.cc/${{ github.repository }} + tags: | + type=raw,value=latest,enable=${{ github.ref_name == 'main' }} + type=raw,value=${{ env.app_version }},enable=${{ github.ref_name == 'main' }} + - name: Checkout Etherpad + container: git + run: | + wget https://github.com/ether/etherpad-lite/archive/refs/tags/v${{ env.app_version }}.tar.gz + tar -xf ${{ env.app_version }}.tar.gz + mv ${{ env.app_version }} etherpad-lite + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + ETHERPAD_PLUGINS=${{ env.app_plugins }} + INSTALL_SOFFICE=true diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 09a445d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -stages: - - release - -docker: - stage: release - services: - - docker:dind - variables: - BRANCH: develop - PLUGINS: ep_font_size ep_font_family ep_font_color ep_spellcheck ep_table_of_contents ep_subscript_and_superscript ep_mammoth ep_print ep_comments_page ep_embedded_hyperlinks2 ep_adminpads2 ep_align ep_headings2 ep_cursortrace ep_markdown ep_set_title_on_pad ep_embedmedia ep_themes ep_rewrite_share_paths - REGISTRY_IMAGE: registry.etke.cc/etke.cc/etherpad - image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/jdrouet/docker-with-buildx:stable - before_script: - - apk --no-cache add git jq - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - - git clone --depth 1 --single-branch -b $BRANCH https://github.com/ether/etherpad-lite.git - - export VERSION=$(cat etherpad-lite/src/package.json | jq -rM .version) - script: - - docker build -t $REGISTRY_IMAGE -t $REGISTRY_IMAGE:$VERSION -t $CI_REGISTRY_IMAGE -t $CI_REGISTRY_IMAGE:$VERSION --build-arg ETHERPAD_PLUGINS="$PLUGINS" --build-arg INSTALL_SOFFICE=true etherpad-lite - - if [[ "$BRANCH" == "develop" ]]; then docker push $REGISTRY_IMAGE; docker push $CI_REGISTRY_IMAGE; fi - - docker push $REGISTRY_IMAGE:$VERSION - - docker push $CI_REGISTRY_IMAGE:$VERSION - tags: - - docker diff --git a/README.md b/README.md index 1ae3de0..cb6e83f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ # etherpad With plugins and LibreOffice - -## how to build specific version - -Run pipeline with variable `BRANCH` set to git tag you want to build, it will create corresponding docker tag