-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: added nightly build Github action (#2526)
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: phpMyFAQ Nightly Build | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
operating-system: ['ubuntu-latest'] | ||
php-versions: ['8.1'] | ||
name: phpMyFAQ Nightly Build | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get current date | ||
id: date | ||
run: | | ||
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
- name: Get Release name | ||
run: | | ||
echo "release_name=nightly-${{ env.date }}" >> $GITHUB_ENV | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag_prefix: development- | ||
custom_tag: ${{ env.release_name }} | ||
|
||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, curl, fileinfo, filter, gd, json, zip, xml, sqlite3, xdebug, pcov | ||
coverage: xdebug | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install PHP dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-dev | ||
|
||
- name: Set Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install JS dependencies | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Run "yarn build" to build frontend production build | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: build | ||
|
||
- name: Create release artifact | ||
uses: montudor/[email protected] | ||
with: | ||
args: zip -X -r phpMyFAQ-${{ env.release_name }}.zip phpmyfaq -x "phpmyfaq/src/libs/tecnickcom/tcpdf/fonts/*" | ||
|
||
- name: Update nightly release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: true | ||
generate_release_notes: false | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
files: phpMyFAQ-${{ env.release_name }}.zip |