Add 2025 fundraising page (#15) #15
This file contains hidden or 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: Deploy CD | |
| on: | |
| # Run on push on production branches | |
| push: | |
| branches: | |
| # Production | |
| - main | |
| paths: | |
| # CI files | |
| - '.github/workflows/deploy.yml' | |
| - 'docker-compose.yml' | |
| - 'docker-compose.cicd.yml' | |
| - '.env' | |
| # Application files | |
| - 'app/**' | |
| # 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: 15 | |
| steps: | |
| # Steps dependencies | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Execution steps | |
| - name: Copy Git history in app source folder | |
| run: | | |
| # Copy app source code git history | |
| # Initialize Git repository in app source code directory | |
| ( | |
| cd app/app && | |
| rm -rf .git && | |
| git init -b main && | |
| git config receive.denyCurrentBranch ignore | |
| ) | |
| # Get Git history of app source code | |
| git subtree split --prefix=app/app -b app-history | |
| # Push Git history to app source code directory | |
| ( | |
| git remote add app ./app/app/.git && | |
| git push app app-history:main && | |
| git branch -D app-history && | |
| git remote remove app | |
| ) | |
| - name: Pull dependencies | |
| run: | | |
| # docker compose pull --ignore-buildable | |
| docker compose \ | |
| -f ./docker-compose.yml -f ./docker-compose.cicd.yml \ | |
| --env-file .env \ | |
| pull --ignore-buildable | |
| - 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 | |
| export DOCKER_UID="$(id -u)" | |
| docker compose \ | |
| -f ./docker-compose.yml -f ./docker-compose.cicd.yml \ | |
| --env-file .env \ | |
| build | |
| - name: Copy application files | |
| run: | | |
| # docker compose up | |
| export DOCKER_UID="$(id -u)" | |
| docker compose \ | |
| -f ./docker-compose.yml -f ./docker-compose.cicd.yml \ | |
| --env-file .env \ | |
| up | |
| - name: Upload GitHub Pages 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 |