name: deploy web to GitHub Pages on: push: branches: [ master ] paths: - 'web/**' # Allows to run this workflow manually from the Actions tab workflow_dispatch: # Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages permissions: contents: read # Allow one concurrent deployment concurrency: group: 'pages' cancel-in-progress: true jobs: build-landing-page: name: Build landing page runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: landing-page path: './web/public' build-explorer: name: Build capa Explorer Web runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: 'recursive' fetch-depth: 1 show-progress: true - name: Set up Node uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 with: node-version: 24 cache: 'npm' cache-dependency-path: './web/explorer/package-lock.json' - name: Install dependencies run: npm ci working-directory: ./web/explorer - name: Generate release bundle run: npm run build:bundle working-directory: ./web/explorer - name: Zip release bundle run: zip -r public/capa-explorer-web.zip capa-explorer-web working-directory: ./web/explorer - name: Build run: npm run build working-directory: ./web/explorer - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: explorer path: './web/explorer/dist' build-rules: name: Build rules site runs-on: ubuntu-latest steps: - name: Check out the repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: submodules: 'recursive' # full depth so that capa-rules has a full history # and we can construct a timeline of rule updates. fetch-depth: 0 - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.12' - uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2.0.0 - name: Install pagefind uses: supplypike/setup-bin@1fafb085795af4a3f183502f3a9dffa8f7b83217 # v5.0.0 with: uri: "https://github.com/CloudCannon/pagefind/releases/download/v1.1.0/pagefind-v1.1.0-x86_64-unknown-linux-musl.tar.gz" name: "pagefind" version: "1.1.0" - name: Install dependencies working-directory: ./web/rules run: pip install -r requirements.txt - name: Build the website working-directory: ./web/rules run: just build - name: Index the website working-directory: ./web/rules run: pagefind --site "public" # upload the build website to artifacts # so that we can download and inspect, if desired. - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: rules path: './web/rules/public' deploy: name: Deploy site to GitHub Pages permissions: pages: write id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: [build-landing-page, build-explorer, build-rules] steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: landing-page path: './public/' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: explorer path: './public/explorer' - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: rules path: './public/rules' - name: Setup Pages uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 - name: Upload artifact uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 with: path: './public' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0