Build & Deploy #59
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
name: Build & Deploy | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
schedule: | |
# Nightly builds | |
- cron: '0 2 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v4 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Configure environment variables | |
run: | | |
cp .env.example .env | |
echo GITHUB_TOKEN=${{ secrets.API_TOKEN_GITHUB }} >> .env | |
- name: Build the site | |
run: php hyde build --no-interaction | |
- name: Generate commit message | |
id: commit-message | |
run: | | |
# Todo: Would be really cool if we detected if we added any new RFCs, and then add those links to the commit message so they show up in the PR. | |
if [ "${{ github.event_name }}" == "schedule" ]; then | |
echo "message=Nightly Build & Deploy `${{ github.sha }}`" >> $GITHUB_OUTPUT | |
else | |
echo "message=Build & Deploy `${{ github.sha }}`" >> $GITHUB_OUTPUT | |
fi | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'docs' | |
message: ${{ steps.commit-message.outputs.message }} |