Merge pull request #18 from some1galaxy/ci/deploy-dev-en-on-merge
Browse filesAdd GitHub Actions workflow to deploy to dev-en Space on merge to main
123456789101112131415161718192021222324252627282930313233343536373839404142name: Deploy to dev-en Space
on: push: branches: [main] workflow_dispatch: {}
concurrency: group: deploy-dev-en cancel-in-progress: false
permissions: contents: read
jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true
- name: Push to Hugging Face Space (dev-en) env: HF_TOKEN: ${{ secrets.HF_TOKEN }} HF_SPACE_ID: ${{ vars.HF_SPACE_ID }} run: | if [ -z "$HF_TOKEN" ]; then echo "::error::HF_TOKEN secret is not set on this repo (Settings > Secrets and variables > Actions)." exit 1 fi if [ -z "$HF_SPACE_ID" ]; then echo "::error::HF_SPACE_ID variable is not set on this repo (Settings > Secrets and variables > Actions > Variables), format: <owner>/<space-name>." exit 1 fi git remote add space "https://user:${HF_TOKEN}@huggingface.co/spaces/${HF_SPACE_ID}" # No --force: a non-fast-forward push means the Space diverged from GitHub # (e.g. edited directly in the HF UI) and needs a human to reconcile it, # rather than silently overwriting that history. git push space HEAD:main.github/workflows/deploy-dev-en.ymlAdded+42