Skip to content

.github/workflows/baseline.yml #1057

.github/workflows/baseline.yml

.github/workflows/baseline.yml #1057

Workflow file for this run

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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
- name: Login to GitHub Container Registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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'