Skip to content

Commit 7a8d5d6

Browse files
committed
Merge pull request #3 from c3n21/feature/deploy-github-pages
1 parent ff08210 commit 7a8d5d6

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: Deploy to GitHub Pages
22

3-
inputs:
4-
cv-json:
5-
description: 'Actual JSON of the CV'
6-
type: string
7-
required: true
8-
93
on:
104
# Trigger the workflow every time you push to the `main` branch
115
# Using a different branch name? Replace `main` with your branch’s name
126
push:
137
branches: [ main ]
148
# Allows you to run this workflow manually from the Actions tab on GitHub.
159
workflow_dispatch:
10+
inputs:
11+
cv-json:
12+
description: 'Actual JSON of the CV'
13+
type: string
14+
required: true
1615

1716
# Allow this job to clone the repo and create a page deployment
1817
permissions:
@@ -27,13 +26,16 @@ jobs:
2726
- name: Checkout your repository using git
2827
uses: actions/checkout@v4
2928
- name: Write cv.json from input
30-
run: echo '${{ inputs.cv-json }}' > src/cv.json
29+
run: |
30+
cat <<EOF > src/cv.json
31+
${{ inputs.cv-json }}
32+
EOF
3133
- name: Install, build, and upload your site
3234
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)
35+
with:
36+
path: . # The root location of your Astro project inside the repository. (optional)
37+
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
38+
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)
3739

3840
deploy:
3941
needs: build

.nojekyll

Whitespace-only changes.

astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import tailwindcss from '@tailwindcss/vite'
55
// https://astro.build/config
66
export default defineConfig({
77
site: 'https://c3n21.github.io',
8-
// base: 'personal-portfolio',
8+
base: 'personal-portfolio',
9+
// opening index.html locally will break because it uses absolute path
10+
build: {
11+
assetsPrefix: './', // This makes asset paths relative
12+
},
913
vite: {
1014
plugins: [tailwindcss()],
1115
},

0 commit comments

Comments
 (0)