Upload binaries to docs only in my repo and in master and dev branches

This commit is contained in:
Oleg Kalachev
2026-08-12 07:19:23 +03:00
parent 0139d71b12
commit f355cc2938
+6 -4
View File
@@ -25,6 +25,8 @@ jobs:
build_book: build_book:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: markdownlint needs: markdownlint
env:
BINARIES: ${{ github.event_name == 'push' && (github.ref_name == 'master' || github.ref_name == 'dev') && github.repository == 'okalachev/flix' }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install mdBook - name: Install mdBook
@@ -32,7 +34,7 @@ jobs:
- name: Build book - name: Build book
run: cd docs && mdbook build run: cd docs && mdbook build
- name: Wait for Build to complete - name: Wait for Build to complete
if: ${{ vars.DOCS_BINARIES == '1' }} if: ${{ env.BINARIES }}
uses: lewagon/wait-on-check-action@v1.9.1 uses: lewagon/wait-on-check-action@v1.9.1
with: with:
ref: ${{ github.sha }} ref: ${{ github.sha }}
@@ -40,7 +42,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30 wait-interval: 30
- name: Find firmware binaries - name: Find firmware binaries
if: ${{ vars.DOCS_BINARIES == '1' }} if: ${{ env.BINARIES }}
id: build_run id: build_run
run: | run: |
RUN_ID=$(gh api "repos/${{ github.repository }}/actions/workflows/build.yml/runs?head_sha=${{ github.sha }}&per_page=1" --jq '.workflow_runs[0].id') RUN_ID=$(gh api "repos/${{ github.repository }}/actions/workflows/build.yml/runs?head_sha=${{ github.sha }}&per_page=1" --jq '.workflow_runs[0].id')
@@ -48,7 +50,7 @@ jobs:
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download firmware binaries - name: Download firmware binaries
if: ${{ vars.DOCS_BINARIES == '1' }} if: ${{ env.BINARIES }}
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -57,7 +59,7 @@ jobs:
name: firmware-binary name: firmware-binary
path: docs/build path: docs/build
- name: Create shortcuts for firmware binaries - name: Create shortcuts for firmware binaries
if: ${{ vars.DOCS_BINARIES == '1' }} if: ${{ env.BINARIES }}
working-directory: docs/build working-directory: docs/build
run: | run: |
for FQBN in esp32.esp32.*; do for FQBN in esp32.esp32.*; do