build_application #76
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 | |
on: [repository_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
repository: biigle/core | |
ref: dev-modules | |
fetch-depth: 1 | |
path: core | |
- name: Copy .env | |
run: cp .env.example .env | |
working-directory: ../core | |
- name: Set testing key | |
run: echo "APP_KEY=base64:STZFA4bQKDjE2mlpRPmsJ/okG0eCh4RHd9BghtZeYmQ=" >> .env | |
working-directory: ../core | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
working-directory: ../core | |
- name: Install Dependencies | |
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist --ignore-platform-reqs | |
working-directory: ../core | |
- name: Remove BIIGLE modules | |
run: rm -r vendor/biigle | |
working-directory: ../core | |
- name: Update BIIGLE modules from source | |
run: composer update --no-ansi --no-interaction --no-scripts --no-suggest --prefer-source --ignore-platform-reqs biigle/* | |
working-directory: ../core | |
- name: Fetch base images | |
run: | | |
docker pull ghcr.io/biigle/app:latest | |
docker pull ghcr.io/biigle/pgvector:latest | |
- name: Start database | |
run: | | |
docker-compose up -d --no-build app database | |
sleep 5 | |
working-directory: ../core | |
- name: Perform migrations | |
run: docker-compose exec -Tu 0 app php artisan migrate --force | |
env: | |
COMPOSE_INTERACTIVE_NO_CLI: 1 | |
working-directory: ../core | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Download Schemaspy | |
run: curl -LO https://github.com/schemaspy/schemaspy/releases/download/v6.1.0/schemaspy-6.1.0.jar | |
- name: Download PostgreSQL JDBC driver | |
run: curl -LO https://jdbc.postgresql.org/download/postgresql-42.2.12.jar | |
- name: Install graphviz | |
run: sudo apt-get install -y graphviz | |
- name: Clean output directory | |
run: rm -r docs | |
- name: Run Schemaspy | |
run: java -jar schemaspy-6.1.0.jar -dp postgresql-42.2.12.jar -o docs | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Update schema $(date -Iseconds)" | |
- name: Push changes | |
uses: ad-m/github-push-action@6defe3bd9f0a0846636a7d99ab96ccc75f2c858b | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |