Skip to content

Commit

Permalink
add Github Actions to make the deployment on push
Browse files Browse the repository at this point in the history
  • Loading branch information
David Martinelli committed Feb 18, 2024
1 parent 04b77b1 commit 258c213
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy content to Github Pages

on:
push:
branches: ['master']

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

env:
VITE_BASE_URL: ${{secrets.VITE_BASE_URL}}
VITE_GH_TOKEN: ${{secrets.VITE_GH_TOKEN}}

jobs:
deploy:
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install deps
run: pnpm
- name: Build
run: pnpm build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './dist'
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import tsconfigPaths from 'vite-tsconfig-paths';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
base: 'github-blog',
server: {
port: 3000,
},
Expand Down

0 comments on commit 258c213

Please sign in to comment.