Skip to content

Commit ff08210

Browse files
authored
Merge pull request #2 from c3n21/feature/deploy-github-pages
deploy workflow
2 parents 465ab5e + 95577a7 commit ff08210

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy to GitHub Pages
2+
3+
inputs:
4+
cv-json:
5+
description: 'Actual JSON of the CV'
6+
type: string
7+
required: true
8+
9+
on:
10+
# Trigger the workflow every time you push to the `main` branch
11+
# Using a different branch name? Replace `main` with your branch’s name
12+
push:
13+
branches: [ main ]
14+
# Allows you to run this workflow manually from the Actions tab on GitHub.
15+
workflow_dispatch:
16+
17+
# Allow this job to clone the repo and create a page deployment
18+
permissions:
19+
contents: read
20+
pages: write
21+
id-token: write
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout your repository using git
28+
uses: actions/checkout@v4
29+
- name: Write cv.json from input
30+
run: echo '${{ inputs.cv-json }}' > src/cv.json
31+
- name: Install, build, and upload your site
32+
uses: withastro/action@v3
33+
# with:
34+
# path: . # The root location of your Astro project inside the repository. (optional)
35+
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
36+
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
37+
38+
deploy:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import tailwindcss from '@tailwindcss/vite'
44

55
// https://astro.build/config
66
export default defineConfig({
7+
site: 'https://c3n21.github.io',
8+
// base: 'personal-portfolio',
79
vite: {
810
plugins: [tailwindcss()],
911
},

0 commit comments

Comments
 (0)