example / .github /workflows /deploy-to-production.yaml
Ray Chen
new: argument to identify different deploying mode
f3efd95
name: Deploy Production
run-name: Deploy to production space
on:
push:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
run_deploy_tool:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Update Repo README.md
run: |
python3 .github/tools/generate_readme.py --mode="prod" > README.md
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions[bot]"
git add ./README.md
if [[ `git status --porcelain` ]]; then
git commit -m "[skip ci] update README.md"
fi
- name: Run deploy tool
run: |
python3 .github/tools/deploy_to_space.py \
--mode="prod" \
--branch_name="${{ github.ref_name }}" \
--username="${{ vars.HF_USERNAME }}" \
--user_token="${{ secrets.HF_TOKEN }}"