diff --git a/.github/workflows/deploy-develop.yml b/.github/workflows/deploy-develop.yml new file mode 100644 index 0000000..e1e1fc5 --- /dev/null +++ b/.github/workflows/deploy-develop.yml @@ -0,0 +1,38 @@ +name: Deploy Develop + +env: + APP_LOCATION: '' + OUTPUT_LOCATION: 'packages/website/build' + +on: + push: + branches: [main] + +permissions: + contents: read + +jobs: + deploy-dev: + runs-on: ubuntu-latest + name: Deploy to Dev Environment + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Deploy to Development + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_DEV_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + output_location: ${{ env.OUTPUT_LOCATION }} + app_location: ${{ env.APP_LOCATION }} + app_build_command: 'pnpm website build' + action: 'upload' + skip_api_build: true + deployment_environment: 'dev' + env: + CUSTOM_BUILD_COMMAND: npm i -g corepack@latest && corepack prepare && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build + ENABLE_NODE_MONOREPO_BUILD: true + NODE_VERSION: 22 \ No newline at end of file diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml deleted file mode 100644 index b64cb03..0000000 --- a/.github/workflows/deploy-docs.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Docs Deployment - -env: - APP_LOCATION: '' - OUTPUT_LOCATION: 'packages/website/build' - -on: - push: - branches: - - main - pull_request: - branches: - - main - -permissions: - issues: write - contents: read - pull-requests: write - -jobs: - check_for_pr: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - name: Check for PR - env: - ENABLE_NODE_MONOREPO_BUILD: true - NODE_VERSION: 22 - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Enable Corepack - run: corepack enable - - - name: Install pnpm - run: corepack prepare pnpm@10.9.0 --activate - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build UI - run: pnpm ui build - - - name: Build Website - run: pnpm website build - - - name: Run lint, format, typecheck, file-lint - run: pnpm lint:fix && pnpm format && pnpm typecheck && pnpm file-lint - - build_and_deploy: - if: github.event_name == 'push' - runs-on: ubuntu-latest - name: Build and Deploy - steps: - - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 - with: - submodules: true - - - name: Deploy - uses: Azure/static-web-apps-deploy@4d27395796ac319302594769cfe812bd207490b1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - output_location: ${{ env.OUTPUT_LOCATION }} - app_location: ${{ env.APP_LOCATION }} - app_build_command: 'pnpm website build' - action: 'upload' - skip_api_build: true - env: - CUSTOM_BUILD_COMMAND: corepack enable && corepack prepare pnpm@10.9.0 --activate && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build - ENABLE_NODE_MONOREPO_BUILD: true - NODE_VERSION: 22 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/deploy-production.yml similarity index 54% rename from .github/workflows/npm-publish.yml rename to .github/workflows/deploy-production.yml index 73c3fe4..15205bd 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/deploy-production.yml @@ -1,38 +1,47 @@ -name: Publish @synergycodes/axiom package to NPM +name: Deploy Production + +env: + APP_LOCATION: '' + OUTPUT_LOCATION: 'packages/website/build' on: push: - branches: - - main + branches: ['release/*'] + +permissions: + contents: read jobs: - publish: + deploy-production: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [22] - permissions: - contents: read - packages: write - + name: Deploy to Production steps: - - name: Checkout repo + - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 2 + submodules: true - - name: Install pnpm - uses: pnpm/action-setup@v4 - - - name: Use Node.js ${{ matrix.node-version }} + - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' + node-version: 22 + registry-url: 'https://registry.npmjs.org' + + - name: Enable Corepack + run: npm i -g corepack@latest + + - name: Install pnpm + run: corepack prepare - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Build UI Package + run: pnpm ui build + + - name: Build Documentation + run: pnpm website build + - name: Read versions id: version-check run: | @@ -66,3 +75,19 @@ jobs: fi env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Deploy Documentation to Production + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_PROD_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + output_location: ${{ env.OUTPUT_LOCATION }} + app_location: ${{ env.APP_LOCATION }} + app_build_command: 'pnpm website build' + action: 'upload' + skip_api_build: true + deployment_environment: 'release' + env: + CUSTOM_BUILD_COMMAND: corepack enable && corepack prepare pnpm@10.9.0 --activate && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build + ENABLE_NODE_MONOREPO_BUILD: true + NODE_VERSION: 22 \ No newline at end of file diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml new file mode 100644 index 0000000..00494d1 --- /dev/null +++ b/.github/workflows/validate-pr.yml @@ -0,0 +1,51 @@ +name: Validate PR + +env: + APP_LOCATION: '' + OUTPUT_LOCATION: 'packages/website/build' + +on: + pull_request: + branches: [main, 'release/*'] + +permissions: + contents: read + pull-requests: write + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate PR + env: + ENABLE_NODE_MONOREPO_BUILD: true + NODE_VERSION: 22 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Enable Corepack + run: npm i -g corepack@latest + + - name: Install pnpm + run: corepack prepare + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build UI Package + run: pnpm ui build + + - name: Build Documentation + run: pnpm website build + + - name: Run Quality Checks + run: | + pnpm lint:fix + pnpm format + pnpm typecheck + pnpm file-lint \ No newline at end of file