From 052a4dfc2143929370353c34888603c8ceb20be1 Mon Sep 17 00:00:00 2001 From: martyanov-av Date: Mon, 16 Oct 2023 18:54:48 +0300 Subject: [PATCH 1/4] feat: add workflows --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ .github/workflows/release.yml | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..81ffda2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build + +on: + pull_request: + +jobs: + build-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build + uses: diplodoc-platform/docs-build-action@v1 + with: + revision: "pr-${{ github.event.pull_request.number }}" + project-name: ${{ secrets.DIPLODOC_PROJECT_NAME }} + src-root: "./" + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} + storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} + storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} + storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} + storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} + shared-storage-bucket: "true" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..430e4f6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Release + uses: diplodoc-platform/docs-release-action@v1 + with: + revision: "${{ github.sha }}" + project-name: ${{ secrets.DIPLODOC_PROJECT_NAME }} + src-root: "./" + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} + storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} + storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} + storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} + storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} + shared-storage-bucket: "true" \ No newline at end of file From 5720c619bd0d966ffc217e86719f64079881cc3f Mon Sep 17 00:00:00 2001 From: martyanov-av Date: Tue, 17 Oct 2023 15:13:36 +0300 Subject: [PATCH 2/4] fix: project in vars --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81ffda2..6655563 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,8 @@ jobs: uses: diplodoc-platform/docs-build-action@v1 with: revision: "pr-${{ github.event.pull_request.number }}" - project-name: ${{ secrets.DIPLODOC_PROJECT_NAME }} - src-root: "./" + project-name: ${{ vars.DIPLODOC_PROJECT_NAME }} + src-root: "./docs" storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 430e4f6..b4e2e8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,11 +13,10 @@ jobs: uses: diplodoc-platform/docs-release-action@v1 with: revision: "${{ github.sha }}" - project-name: ${{ secrets.DIPLODOC_PROJECT_NAME }} - src-root: "./" + project-name: ${{ vars.DIPLODOC_PROJECT_NAME }} + src-root: "./docs" storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} - storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} - shared-storage-bucket: "true" \ No newline at end of file + storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} \ No newline at end of file From 31ed60906a9d65ce260d1f62b5ca3dedcc10cc28 Mon Sep 17 00:00:00 2001 From: martyanov-av Date: Tue, 17 Oct 2023 20:35:43 +0300 Subject: [PATCH 3/4] feat: check for DIPLODOC_STORAGE_BUCKET secret --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4e2e8f..6f6e48d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,11 @@ jobs: release: runs-on: ubuntu-latest steps: + - name: "Check is DIPLODOC_STORAGE_BUCKET secret exists" + env: + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} + if: ${{ env.storage-bucket == '' }} + run: 'echo "::error:: The secret \"DIPLODOC_STORAGE_BUCKET\" has not been made; please check that all necessary secrets and variables are installed or follow the link https://diplodoc.com/quickstart" && exit 1' - name: Checkout uses: actions/checkout@v3 - name: Release @@ -19,4 +24,4 @@ jobs: storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} - storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} \ No newline at end of file + storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} From b3ee68e48b1aed6ff2d6ef001bdbd7e67ee6b898 Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sun, 22 Oct 2023 18:41:08 +0300 Subject: [PATCH 4/4] Update actions to v2 --- .github/workflows/build.yml | 10 ++++------ .github/workflows/release.yml | 16 +++++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6655563..42ebbb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,14 +10,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Build - uses: diplodoc-platform/docs-build-action@v1 + uses: diplodoc-platform/docs-build-action@v2 with: revision: "pr-${{ github.event.pull_request.number }}" - project-name: ${{ vars.DIPLODOC_PROJECT_NAME }} src-root: "./docs" - storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} - storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} - storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} - shared-storage-bucket: "true" \ No newline at end of file + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} + storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} + storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f6e48d..c5561f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,14 +14,20 @@ jobs: run: 'echo "::error:: The secret \"DIPLODOC_STORAGE_BUCKET\" has not been made; please check that all necessary secrets and variables are installed or follow the link https://diplodoc.com/quickstart" && exit 1' - name: Checkout uses: actions/checkout@v3 - - name: Release - uses: diplodoc-platform/docs-release-action@v1 + - name: Build + uses: diplodoc-platform/docs-build-action@v2 with: revision: "${{ github.sha }}" - project-name: ${{ vars.DIPLODOC_PROJECT_NAME }} src-root: "./docs" - storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} storage-endpoint: ${{ vars.DIPLODOC_STORAGE_ENDPOINT }} + storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }} + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} + storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} + storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} + - name: Release + uses: diplodoc-platform/docs-release-action@v2 + with: + revision: "${{ github.sha }}" + storage-bucket: ${{ secrets.DIPLODOC_STORAGE_BUCKET }} storage-access-key-id: ${{ secrets.DIPLODOC_ACCESS_KEY_ID }} storage-secret-access-key: ${{ secrets.DIPLODOC_SECRET_ACCESS_KEY }} - storage-region: ${{ vars.DIPLODOC_STORAGE_REGION }}