mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-01-30 03:17:39 +01:00
Add experimental build workflow for #184
This commit is contained in:
parent
27bb48a0e4
commit
742b6c7cb1
99
.github/workflows/build.yml
vendored
Normal file
99
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
name: Testing
|
||||
|
||||
#on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# FOR TESTING ENABLED ON PULL REQUEST
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
build-js:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
name: Build assets for the package
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js 14.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Try to build the assets
|
||||
run: |
|
||||
npm ci
|
||||
npm run production
|
||||
|
||||
- name: Upload built assets
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: assets
|
||||
path: public/assets/dist
|
||||
|
||||
- name: Upload mix manifest
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: mix-manifest
|
||||
path: public/mix-manifest.json
|
||||
|
||||
build-package:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-js
|
||||
|
||||
name: Build final dist package
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: assets
|
||||
path: public/assets/dist
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: mix-manifest
|
||||
path: public
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.3'
|
||||
extensions: mbstring
|
||||
|
||||
- name: Get Composer Cache Directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-composer-
|
||||
|
||||
- name: Prepare the environment
|
||||
run: cp .env.example .env
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress --no-suggest
|
||||
|
||||
- name: Remove .env file
|
||||
run: rm .env
|
||||
|
||||
- name: Install zip
|
||||
run: apt install -y zip
|
||||
- name: Create zip package with all files
|
||||
run: zip -r /tmp/linkace.zip $GITHUB_WORKSPACE
|
||||
|
||||
- name: Upload the package
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: mix-manifest
|
||||
path: /tmp/linkace.zip
|
Loading…
x
Reference in New Issue
Block a user