From 864c8433e8e5b613c60f64f9228f9e1c006a9a36 Mon Sep 17 00:00:00 2001 From: zsinx6 Date: Fri, 20 Mar 2026 10:21:35 -0300 Subject: [PATCH 1/2] Atualiza CI e arruma preview --- .github/workflows/deploy.yml | 13 +++++- .github/workflows/preview-fork.yml | 64 ++++++++++++++++++++++++++++++ .github/workflows/preview.yml | 9 +++-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/preview-fork.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 52b4806..6dfbe87 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,10 @@ on: branches: - main +concurrency: + group: gh-pages + cancel-in-progress: false + permissions: contents: write @@ -24,5 +28,12 @@ jobs: - name: Install dependencies run: | poetry install --without dev + - name: Build + run: poetry run make html - name: Deploy - run: poetry run make deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/html + branch: gh-pages + force: false + clean-exclude: pr-preview/ diff --git a/.github/workflows/preview-fork.yml b/.github/workflows/preview-fork.yml new file mode 100644 index 0000000..b36512d --- /dev/null +++ b/.github/workflows/preview-fork.yml @@ -0,0 +1,64 @@ +name: Deploy Fork PR Preview + +# Org admins can manually deploy/remove a preview for a PR from a fork. +# rossjrw/pr-preview-action@v1 does not support forks automatically, +# so this workflow is the workaround until v2 is released. +# +# ⚠️ Only trigger this after reviewing the fork's code, since it checks +# out and runs code from the PR branch. + +on: + workflow_dispatch: + inputs: + pr_number: + description: 'PR number (from a fork)' + required: true + type: number + action: + description: 'Action to perform' + type: choice + options: + - deploy + - remove + default: deploy + +concurrency: + group: gh-pages + cancel-in-progress: false + +permissions: + contents: write + pull-requests: write + +jobs: + deploy-fork-preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: refs/pull/${{ inputs.pr_number }}/head + + - uses: actions/setup-python@v6 + if: inputs.action == 'deploy' + with: + python-version: '3.10' + + - uses: abatilo/actions-poetry@v4 + if: inputs.action == 'deploy' + with: + poetry-version: 2.1.4 + + - name: Install dependencies + if: inputs.action == 'deploy' + run: poetry install --without dev + + - name: Build + if: inputs.action == 'deploy' + run: poetry run make html + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./build/html/ + pr-number: ${{ inputs.pr_number }} + action: ${{ inputs.action }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 9fa8dde..6783406 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -8,9 +8,9 @@ on: - synchronize - closed -concurrency: - group: preview-${{ github.ref }} - cancel-in-progress: true +concurrency: + group: gh-pages + cancel-in-progress: false permissions: contents: write @@ -29,10 +29,13 @@ jobs: poetry-version: 2.1.4 - name: Install dependencies + if: github.event.action != 'closed' run: poetry install --without dev - name: Build + if: github.event.action != 'closed' run: poetry run make html - name: Deploy preview uses: rossjrw/pr-preview-action@v1 + if: github.event.pull_request.head.repo.full_name == github.repository with: source-dir: ./build/html/ From eb5bd30c5db687bbd9737965f66d0e8a070dfc40 Mon Sep 17 00:00:00 2001 From: zsinx6 Date: Fri, 20 Mar 2026 10:26:45 -0300 Subject: [PATCH 2/2] Arruma commit hash no CI --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/preview-fork.yml | 4 ++-- .github/workflows/preview.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6dfbe87..81703dc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.10' - - uses: abatilo/actions-poetry@v4 + - uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8 # v4 with: poetry-version: 2.1.4 @@ -31,7 +31,7 @@ jobs: - name: Build run: poetry run make html - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4 with: folder: build/html branch: gh-pages diff --git a/.github/workflows/preview-fork.yml b/.github/workflows/preview-fork.yml index b36512d..9ca199f 100644 --- a/.github/workflows/preview-fork.yml +++ b/.github/workflows/preview-fork.yml @@ -43,7 +43,7 @@ jobs: with: python-version: '3.10' - - uses: abatilo/actions-poetry@v4 + - uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8 # v4 if: inputs.action == 'deploy' with: poetry-version: 2.1.4 @@ -57,7 +57,7 @@ jobs: run: poetry run make html - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 + uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1 with: source-dir: ./build/html/ pr-number: ${{ inputs.pr_number }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 6783406..6f2a89b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.10' - - uses: abatilo/actions-poetry@v4 + - uses: abatilo/actions-poetry@0dd19c9498c3dc8728967849d0d2eae428a8a3d8 # v4 with: poetry-version: 2.1.4 @@ -35,7 +35,7 @@ jobs: if: github.event.action != 'closed' run: poetry run make html - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 + uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1 if: github.event.pull_request.head.repo.full_name == github.repository with: source-dir: ./build/html/