Skip to content

Commit

Permalink
Fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
arecvlohe committed Oct 24, 2022
1 parent 6a9cd80 commit c6c0c04
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Github Pages Astro CI

on:
push:
branches: [latest]
workflow_dispatch:

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v2
- name: Install, build, and upload your site
uses: withastro/action@v0
# with:
# path: . # The root location of your Astro project inside the repository. (optional)
# node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional)
# package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)

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
13 changes: 9 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
image: node:16.13.0
image: node:14

pages:
cache:
paths:
- node_modules/
script:
- npm install
- BUILD_GITLAB=true npm run build
- rm -rf ./public/* && cp -r ./dist/* ./public
# Specify the steps involved to build your app here
- yarn install
- yarn build

artifacts:
paths:
- public

only:
# Trigger a new build and deploy only when there is a push to the
# branch(es) below
- latest
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default defineConfig({
? "https://adamrecvlohe.com"
: "https://arecvlohe.github.io",
outDir: process.env.BUILD_GITLAB ? "public" : undefined,
publicDir: process.env.BUILD_GITLAB ? "static" : undefined,
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"deploy": "git push gitlab latest && yarn build && touch ./dist/.nojekyll && gh-pages -d dist -t true"
"push:gitlab": "git push gitlab latest"
},
"devDependencies": {
"@astrojs/preact": "1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export interface Props {
permalink: string;
}
const { title, description, permalink } = Astro.props;
const logoUrl = "/assets/logo.jpg";
const logoUrl = "/static/assets/logo.jpg";
---

<!-- Global Metadata -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" />

<!-- Primary Meta Tags -->
<title>{title}</title>
Expand Down
File renamed without changes
File renamed without changes.

0 comments on commit c6c0c04

Please sign in to comment.