Skip to content

Commit

Permalink
add deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
cfahlgren1 committed Oct 2, 2024
1 parent fe5c0fb commit 9989d18
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to Hugging Face Spaces

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Push to Hugging Face Spaces
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add dist -f
git commit -m "Update build artifacts"
git push https://${{ secrets.HF_USERNAME }}:[email protected]/spaces/${{ secrets.HF_USERNAME }}/${{ secrets.SPACE_NAME }} main

0 comments on commit 9989d18

Please sign in to comment.