Skip to content

Commit

Permalink
feat: deploy site
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Feb 11, 2024
1 parent 12db9c4 commit c455ccf
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions apps/site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),
});

0 comments on commit c455ccf

Please sign in to comment.