Skip to content

Reorder events in root sidebar #28

Reorder events in root sidebar

Reorder events in root sidebar #28

Workflow file for this run

name: Check CI
# GitHub variables:
# - VERSION_TAG
# - ASTRO_SITE_URL
# - ASTRO_BASE_PATH
# - ASTRO_ASSETS_PREFIX
# GitHub secrets: N/A
on:
# Run on pull requests to primary branches
pull_request:
branches:
# Production
- main
# Staging
- staging
# Development
- dev
paths:
# CI/CD files
- '.github/workflows/check.yml'
- 'docker-compose.yml'
- 'docker-compose.cicd.yml'
- '.env'
# Application files
- 'app/**'
# Run on manual triggers
workflow_dispatch:
# Set default 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:
# 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:
# Build configuration
BUILD_CHECK: 'true' # Run type checks
# Deployment configuration
GITHUB_REPOSITORY_URL: https://github.com/${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
VERSION_TAG: ${{ vars.VERSION_TAG }}
# Astro configuration
ASTRO_SITE_URL: ${{ vars.ASTRO_SITE_URL }}
ASTRO_BASE_PATH: ${{ vars.ASTRO_BASE_PATH }}
ASTRO_ASSETS_PREFIX: ${{ vars.ASTRO_ASSETS_PREFIX }}
# Application configuration
# Add env vars for your application here.
run: |
# docker compose build
echo '::group::Build details'
export DOCKER_UID="$(id -u)"
docker compose \
-f ./docker-compose.yml -f ./docker-compose.cicd.yml \
--env-file .env \
build
echo '::endgroup::'
- 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: Check application files
run: |
# Check application files
[ -d ./app/dist ] && [ $(ls -1 ./app/dist | wc -l) -gt 0 ] \
&& echo 'Application files found' \
|| ( echo 'No application files found' && exit 1 )