Fix Whilelist #14
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: Build Application | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
permissions: write-all | |
runs-on: ubuntu-latest # Machine To Run On | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Node.js Setup | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20.x | |
- name: Cache node_modules directory | |
uses: actions/cache@v2 | |
id: node_modules-cache | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install NPM packages | |
if: steps.node_modules-cache.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
- name: Get Composer Cache Directory 2 | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
id: actions-cache | |
with: | |
path: '${{ steps.composer-cache.outputs.dir }}' | |
key: '${{ runner.os }}-composer-${{ hashFiles(''**/composer.lock'') }}' | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Cache PHP dependencies | |
uses: actions/cache@v2 | |
id: vendor-cache | |
with: | |
path: vendor | |
key: '${{ runner.OS }}-build-${{ hashFiles(''**/composer.lock'') }}' | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" # If .env exist, we use that, if otherwise, copy .env.example to .env and use that instead | |
- name: Create DB File | |
run: touch database/database.sqlite | |
- name: Install Dependencies | |
if: steps.vendor-cache.outputs.cache-hit != 'true' | |
run: composer install -q --no-ansi --no-interaction --no-dev --no-progress --prefer-dist | |
- name: Build frontend | |
run: npm run build | |
- name: Create an Archive For Release | |
uses: montudor/[email protected] | |
with: | |
args: zip -X -r production-ready.zip . -x ".git/*" "node_modules/*" "tests/*" ".github/*" package* phpunit.xml # We excluding git, node_modules, and others not needed in production | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: production-ready.zip | |
path: production-ready.zip | |
- name: Upload Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: production-ready.zip | |
asset_name: production-ready.zip | |
tag: ${{ github.ref }} | |
overwrite: true | |
body: "Latest Release" |