Skip to content

Commit

Permalink
feat(cd): add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iamandrewluca committed Jun 12, 2024
1 parent b7e3f85 commit c1d0494
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- run: ./scripts/clone-1loc.sh
- run: npm ci
- run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion scripts/clone-1loc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ rm -rf src/content/lines
mkdir -p src/content/lines
git clone --depth 1 https://github.com/iamandrewluca/1loc.git 1loc
cp -r 1loc/contents/ src/content/lines/
rm -rf 1loc
rm -rf 1loc
ls -l src/content/lines

0 comments on commit c1d0494

Please sign in to comment.