Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Put binaries into docs artifact only in master and dev branch of the upstream repo

Oleg Kalachev149c891cfcae
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 29f659e..86b7ac7 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -25,6 +25,8 @@ jobs:
build_book:
runs-on: ubuntu-latest
needs: markdownlint
+ env:
+ BINARIES: ${{ github.event_name == 'push' && (github.ref_name == 'master' || github.ref_name == 'dev') && github.repository == 'okalachev/flix' }}
steps:
- uses: actions/checkout@v7
- name: Install mdBook
@@ -32,6 +34,7 @@ jobs:
- name: Build book
run: cd docs && mdbook build
- name: Wait for Build to complete
+ if: ${{ env.BINARIES }}
uses: lewagon/[email protected]
with:
ref: ${{ github.sha }}
@@ -39,6 +42,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
- name: Find firmware binaries
+ if: ${{ env.BINARIES }}
id: build_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')
@@ -46,6 +50,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download firmware binaries
+ if: ${{ env.BINARIES }}
uses: actions/download-artifact@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -54,6 +59,7 @@ jobs:
name: firmware-binary
path: docs/build
- name: Create shortcuts for firmware binaries
+ if: ${{ env.BINARIES }}
working-directory: docs/build
run: |
for FQBN in esp32.esp32.*; do