From cee4d8148cbb9c90c90004fbf845740a96ddee72 Mon Sep 17 00:00:00 2001 From: Illia Shestakov Date: Thu, 14 Sep 2023 11:54:57 +0300 Subject: [PATCH] Move CI to GitLab --- .github/workflows/commmunity-theme-tutor.yml | 15 ------------ .github/workflows/release.yml | 25 -------------------- .github/workflows/sync.yml | 23 ++++++++++++++++++ .github/workflows/tutor.yml | 17 ------------- .gitlab-ci.yml | 9 +++++++ 5 files changed, 32 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/commmunity-theme-tutor.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/sync.yml delete mode 100644 .github/workflows/tutor.yml create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/commmunity-theme-tutor.yml b/.github/workflows/commmunity-theme-tutor.yml deleted file mode 100644 index bafc490c..00000000 --- a/.github/workflows/commmunity-theme-tutor.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Build and deploy tutor -on: - push: - branches: [ "community-theme.palm" ] - -jobs: - deploy: - permissions: - actions: write - runs-on: ubuntu-latest - - steps: - - name: Trigger community-theme-tutor pipeline - run: | - curl --request POST --form token=${{ secrets.GITLAB_PIPELINE_TOKEN }} --form ref=main https://gitlab.com/api/v4/projects/48712583/trigger/pipeline diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 89b3703e..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release -on: - push: - branches: - - community-theme -jobs: - release: - name: Release - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: 18 - - name: Install dependencies - run: npm ci - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} - run: npx semantic-release --branches community-theme diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 00000000..d7719a70 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,23 @@ +name: Sync with private repo + +on: + push: + branches: [ community-theme ] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Sync to GitLab + run: | + mkdir -p ~/.ssh && chmod 700 ~/.ssh + eval $(ssh-agent -s) + echo "${{ secrets.GITLAB_KNOWN_HOSTS }}" > ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts + echo "${{ secrets.COMMUNITY_THEME_SSH_PRIVATE_KEY }}" | ssh-add - + git remote add gitlab $GITLAB_REPOSITORY + git push gitlab $GITHUB_REF + env: + GITLAB_REPOSITORY: git@gitlab.com:abstract-germany/community-theme/community-theme-brand.git diff --git a/.github/workflows/tutor.yml b/.github/workflows/tutor.yml deleted file mode 100644 index 72b7e6f5..00000000 --- a/.github/workflows/tutor.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build and deploy tutor -on: - push: - branches: [ "community-theme" ] - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: trigger community-tutor workflow - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: Bearer ${{ secrets.ORG_ACCESS_TOKEN }}" \ - https://api.github.com/repos/Abstract-Tech/community-theme-tutor/actions/workflows/tutor.yml/dispatches -d '{"ref":"main", "inputs":{"skip_build_openedx_job":"true"}}' diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..d4009ac1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,9 @@ +trigger_job: + trigger: + project: abstract-germany/community-theme/community-theme-tutor + branch: main + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never + - if: '$CI_COMMIT_BRANCH == "community-theme"' + when: always