From 0a4696952c8bcb3270e020ee376c363eaba92be7 Mon Sep 17 00:00:00 2001 From: Hendrik Belitz Date: Thu, 19 Jun 2025 19:28:02 +0200 Subject: [PATCH] Basic implementation of github actions --- .github/workflows/main-deploy.yml | 40 +++++++++++++++++ .github/workflows/pr-checks.yml | 35 +++++++++++++++ .github/workflows/release.yml | 71 +++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 .github/workflows/main-deploy.yml create mode 100644 .github/workflows/pr-checks.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/main-deploy.yml b/.github/workflows/main-deploy.yml new file mode 100644 index 0000000..fe14296 --- /dev/null +++ b/.github/workflows/main-deploy.yml @@ -0,0 +1,40 @@ +name: Main Branch Deploy + +on: + push: + branches: [ main ] + +jobs: + test-build-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run type checking + run: npm run check + + - name: Run linting + run: npm run lint + + - name: Run unit tests + run: npm run test:unit -- --run + + - name: Build application + run: npm run build + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Run E2E tests + run: npm run test:e2e \ No newline at end of file diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..1ba02c7 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,35 @@ +name: PR Checks + +on: + pull_request: + branches: [ main ] + types: [ opened, synchronize, reopened ] + +jobs: + test-and-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run type checking + run: npm run check + + - name: Run linting + run: npm run lint + + - name: Run unit tests + run: npm run test:unit -- --run + + - name: Build application + run: npm run build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..abd8913 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,71 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run type checking + run: npm run check + + - name: Run linting + run: npm run lint + + - name: Run unit tests + run: npm run test:unit -- --run + + - name: Build application + run: npm run build + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Run E2E tests + run: npm run test:e2e + + - name: Create Release Archive + run: | + mkdir -p release-assets + tar -czf release-assets/open-reception-${{ github.ref_name }}.tar.gz build/ + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + name: Release ${{ github.ref_name }} + generate_release_notes: true + body: | + ## Release ${{ github.ref_name }} + + This release includes the latest version of Open Reception appointment booking software. + + ### What's Changed + + + ### Installation + Extract the archive and follow the deployment instructions in the README. + + **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.ref_name }} + files: | + release-assets/open-reception-${{ github.ref_name }}.tar.gz + draft: false + prerelease: ${{ contains(github.ref_name, '-') }} \ No newline at end of file