Skip to content

Initialize app to render documents in web pages (#1) #1

Initialize app to render documents in web pages (#1)

Initialize app to render documents in web pages (#1) #1

Workflow file for this run

name: Deploy CD
on:
# Run on push on production branches
push:
branches:
- main
paths:
- '.github/workflows/deploy.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 }}
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: "false" # Skip 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: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./app/dist
# Deploy job
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 10
# Job dependencies
needs:
- build
# Set GITHUB_TOKEN permissions for the job
permissions:
pages: write
id-token: write
# Set deployment environment
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4