Merge pull request #2584 from flow-php/cache-http-autoinstrumentation… #1160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'Git Tag Name' | |
| required: false | |
| branch_name: | |
| description: 'Git Branch Name' | |
| required: true | |
| default: '1.x' | |
| push: | |
| branches: [ 1.x ] | |
| paths-ignore: | |
| - 'CHANGELOG.md' | |
| schedule: | |
| - cron: '0 3 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-phar: | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dependencies: | |
| - "locked" | |
| php-version: | |
| - "8.3" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "Setup PHP Environment" | |
| uses: "./.github/actions/setup-php-env" | |
| with: | |
| php-version: "${{ matrix.php-version }}" | |
| dependencies: "locked" | |
| coverage: "none" | |
| extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib' | |
| cache-key-suffix: "-locked-phar" | |
| apt-packages: "build-essential autoconf automake libtool protobuf-compiler libprotobuf-c-dev" | |
| pie-extensions: "flow-php/pg-query-ext:1.x-dev" | |
| - name: "Build PHAR file" | |
| run: "just phar" | |
| - name: "Validate Flow PHAR" | |
| run: | | |
| ./build/flow.phar --version | |
| - name: "Upload Flow PHAR for Docker build" | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: "docker-phar" | |
| path: "build/flow.phar" | |
| if-no-files-found: error | |
| retention-days: 1 | |
| - name: "Prepare artifact name" | |
| if: ${{ github.event_name == 'push' }} | |
| shell: bash | |
| run: | | |
| BUILD_TAG=${GITHUB_SHA:0:7} | |
| echo "BUILD_TAG=$BUILD_TAG" >> "$GITHUB_ENV" | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: flow-${{ env.BUILD_TAG }}.phar | |
| path: build/flow.phar | |
| overwrite: true | |
| docker-image: | |
| needs: build-phar | |
| permissions: | |
| contents: read | |
| packages: write | |
| uses: ./.github/workflows/job-docker-image.yml | |
| with: | |
| tags: "ghcr.io/flow-php/flow:latest" | |
| phar-artifact: "docker-phar" | |
| no-cache: ${{ github.event_name == 'schedule' }} | |
| publish-website: | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.3" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "Get Flow Version" | |
| id: flow_version | |
| uses: WyriHaximus/github-action-get-previous-tag@61819f33034117e6c686e6a31dba995a85afc9de # v2.0.0 | |
| with: | |
| fallback: 1.x-dev | |
| - name: "Setup PHP Environment" | |
| uses: "./.github/actions/setup-php-env" | |
| with: | |
| php-version: "${{ matrix.php-version }}" | |
| dependencies: "locked" | |
| extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib' | |
| cache-key-suffix: "-website-phar" | |
| apt-packages: "build-essential autoconf automake libtool protobuf-compiler libprotobuf-c-dev" | |
| pie-extensions: "flow-php/pg-query-ext:1.x-dev" | |
| extra-working-directory: "web/landing" | |
| extra-cache-key-suffix: "-website" | |
| extra-composer-file: "web/landing/composer.lock" | |
| - name: "Generate documentation" | |
| run: "just docs" | |
| - name: "Build latest version Flow Phar for playground" | |
| run: "just phar" | |
| - name: "Build" | |
| run: "composer build" | |
| env: | |
| SCHEME: https | |
| DOMAIN: flow-php.com | |
| PLAYGROUND_API_URL: https://flow-php.com/api/playground/snippets | |
| PLAYGROUND_SNIPPETS_URL: https://playground-snippets.flow-php.com | |
| GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
| UMAMI_ID: '${{ vars.UMAMI_ID }}' | |
| FLOW_VERSION: ${{ steps.flow_version.outputs.tag }} | |
| working-directory: "web/landing" | |
| - name: "Generate Api References" | |
| run: "just docs-api" | |
| - name: "Setup Node.js" | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: '20' | |
| - name: "Build Pagefind index" | |
| run: "npx --yes pagefind@1.5.2 --site web/landing/build --output-subdir pagefind" | |
| - name: Pushes build to website repository | |
| uses: cpina/github-action-push-to-another-repository@55306faa4ed53b815ae49e564af8cfb359d32ae2 # main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.ACCESS_TOKEN }} | |
| with: | |
| source-directory: 'web/landing/build' | |
| destination-github-username: 'flow-php' | |
| destination-repository-name: 'flow-php.com' |