-
-
Notifications
You must be signed in to change notification settings - Fork 53
170 lines (146 loc) · 5.2 KB
/
Copy pathbaseline.yml
File metadata and controls
170 lines (146 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
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'