diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml new file mode 100644 index 00000000..c1005913 --- /dev/null +++ b/.github/workflows/deploy-site.yml @@ -0,0 +1,52 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v2 + with: + node-version: '21.x' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile --prefer-offline --production=false + + - name: Turbo Cache + uses: actions/cache@v3 + with: + path: .turbo + key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }} + restore-keys: | + turbo-${{ github.job }}-${{ github.ref_name }} + + - name: Build + run: yarn build + + - name: Upload Pages Artifact + uses: actions/upload-pages-artifact@v2 + with: + path: 'apps/site/dist/' + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2163172..9d536f10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,11 +16,11 @@ jobs: timeout-minutes: 15 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v2 with: - node-version: '20.x' + node-version: '21.x' cache: 'yarn' - name: Install dependencies diff --git a/apps/site/astro.config.mjs b/apps/site/astro.config.mjs index 647dd61e..4469b652 100644 --- a/apps/site/astro.config.mjs +++ b/apps/site/astro.config.mjs @@ -4,4 +4,8 @@ import tailwind from '@astrojs/tailwind'; export default defineConfig({ integrations: [react(), tailwind()], + ...(process.env.NODE_ENV === 'production' && { + site: 'https://mati365.github.io', + base: '/ts-c-compiler', + }), });