Repository navigation
63 lines (57 loc) · 1.44 KB
/
Copy pathdeploy.yml
File metadata and controls
63 lines (57 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
workflow_call:
secrets:
HF_TOKEN:
required: false
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
queue: max
cancel-in-progress: false
jobs:
deploy:
if: github.repository == 'kishormorol/ResearchScope'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
outputs:
source_sha: ${{ steps.source.outputs.sha }}
steps:
- name: Require main branch
shell: bash
run: |
if [ "${GITHUB_REF:-}" != "refs/heads/main" ]; then
echo "::error::Run this publishing workflow from main."
exit 1
fi
- uses: actions/checkout@v7
with:
ref: main
persist-credentials: false
- name: Record published revision
id: source
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: site/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
sync-space:
needs: deploy
permissions:
contents: read
uses: ./.github/workflows/hf-space.yml
with:
source_sha: ${{ needs.deploy.outputs.source_sha }}
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}