-
-
Notifications
You must be signed in to change notification settings - Fork 53
160 lines (138 loc) · 4.84 KB
/
Copy pathbaseline.yml
File metadata and controls
160 lines (138 loc) · 4.84 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
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'