abenevaut-release #27
Workflow file for this run
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: abenevaut-release | |
on: | |
release: | |
types: [ published ] | |
env: | |
php_version: 8.1 | |
node_version: lts/iron | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: abenevaut-release | |
cancel-in-progress: false | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Get current release tag | |
id: branch_name | |
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | |
- name: Use Node.js ${{ env.node_version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node_version }} | |
registry-url: https://npm.pkg.github.com | |
- name: Configure Node.js cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-nodejs_${{ env.node_version }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-nodejs_${{ env.node_version }}- | |
- name: Setup NPM | |
run: | | |
npm config set "@abenevaut:registry" https://npm.pkg.github.com/ | |
npm config set "//npm.pkg.github.com/:_authToken" $NODE_AUTH_TOKEN | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.ABENEVAUT_GITHUB_TOKEN }} | |
- name: NPM install | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: npm ci --prefer-offline --no-audit --progress=false | |
- name: Initialize PHP ${{ env.php_version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.php_version }} | |
- name: Configure Composer cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/vendor | |
key: ${{ runner.os }}-node-php_${{ env.php_version }}-${{ hashFiles('**/composer.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-php_${{ env.php_version }}- | |
- name: Composer install | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer install -o --no-interaction --prefer-dist | |
- name: Validate composer file | |
run: | | |
composer -V | |
composer validate --strict | |
- name: Generate static pages | |
run: | | |
npm run prod | |
vendor/bin/laravel-one generate https://www.abenevaut.dev | |
- uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
BRANCH: gh-pages | |
FOLDER: dist | |
- name: Publish to wiki | |
uses: SwiftDocOrg/github-wiki-publish-action@v1 | |
with: | |
path: "readme" | |
env: | |
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.ABENEVAUT_GITHUB_TOKEN }} |