Skip to content

Commit

Permalink
chore: switch CI to Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
tydeu committed Nov 3, 2023
1 parent 220d0f5 commit 4318bd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
needs: bundle
name: Deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
name: netlify
url: ${{ github.ref_name == 'master' && steps.publish.outputs.NETLIFY_LIVE_URL || steps.publish.outputs.NETLIFY_URL }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -81,12 +81,16 @@ jobs:
run: npm ci
- name: Build Site
run: npm run generate
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload Pages
uses: actions/upload-pages-artifact@v2
- id: alias
name: Compute Deploy Alias
if: github.ref_name != 'master'
run: python3 -c 'import base64; print("alias="+base64.urlsafe_b64encode(bytes.fromhex("${{github.sha}}")).decode("utf-8"))' >> "$GITHUB_OUTPUT"
- id: publish
name: Publish
uses: netlify/actions/cli@master
with:
path: .output/public
- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@v2
args: deploy --dir=.output/public \
${{ github.ref_name == 'master' && '--prod' || format('--alias={0}', steps.alias.outputs.alias) }}
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default defineNuxtConfig({
}],
],
nitro: {
preset: 'github-pages',
prerender: {
failOnError: true,
// Needed to prevent GitHub Pages from automatically adding trailing
Expand Down

0 comments on commit 4318bd6

Please sign in to comment.