.github/workflows/baseline.yml #929
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-archives: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dependencies: | |
| - "locked" | |
| php-version: | |
| - "8.3" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| 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: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker Image | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| ghcr.io/flow-php/flow:latest | |
| target: flow | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - 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 | |
| publish-website: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: | |
| - "8.3" | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "Get Flow Version" | |
| id: flow_version | |
| uses: WyriHaximus/github-action-get-previous-tag@04e8485ecb6487243907e330d522ff60f02283ce # v1 | |
| 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" | |
| - name: "Generate documentation" | |
| run: "just docs" | |
| - name: "Build latest version Flow Phar for playground" | |
| run: "just phar" | |
| - name: "Install Landing dependencies" | |
| run: "composer install --no-interaction --no-progress " | |
| working-directory: "web/landing" | |
| - 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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| 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' |