Initialize app to render documents in web pages #1
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: Check CI | |
on: | |
# Run on pull requests to primary branches | |
pull_request: | |
branches: | |
- main | |
- dev | |
paths: | |
- '.github/workflows/check.yml' | |
- 'app/**' | |
- 'docker-compose.yml' | |
- 'docker-compose.cicd.yml' | |
# Run on manual triggers | |
workflow_dispatch: | |
# Set GITHUB_TOKEN permissions for the workflow | |
permissions: | |
contents: read | |
# Set workflow concurrency rules | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download FluffEvent association documents | |
run: | | |
# download-documents.sh ./app/app | |
sh ./cicd/download-documents.sh ./app/app | |
- name: Build for production | |
env: | |
GITHUB_REPOSITORY_URL: https://github.com/${{ github.repository }} | |
GITHUB_SHA: ${{ github.sha }} | |
BUILD_CHECK: "true" # Run type checks | |
run: | | |
# docker compose build | |
docker compose \ | |
-f docker-compose.yml -f docker-compose.cicd.yml \ | |
--env-file .env \ | |
build | |
- name: Copy application files | |
run: | | |
# docker compose up | |
docker compose \ | |
-f docker-compose.yml -f docker-compose.cicd.yml \ | |
--env-file .env \ | |
up | |
- name: Chown dist folder to $USER | |
run: | | |
# chown $USER ./app/dist | |
sudo chown -R $USER:$USER ./app/dist | |
- name: Check application files | |
run: | | |
# Verify some application files exist | |
[ -d ./app/dist ] && [ $(ls -1 ./app/dist | wc -l) -gt 0 ] \ | |
&& echo "Application files found" \ | |
|| ( echo "No application files found" && exit 1 ) |