-
Notifications
You must be signed in to change notification settings - Fork 853
Expand file tree
/
Copy pathdeploy-artifacts-to-github-pages.yml
More file actions
86 lines (75 loc) · 3.04 KB
/
deploy-artifacts-to-github-pages.yml
File metadata and controls
86 lines (75 loc) · 3.04 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Deploy Artifacts to GitHub Pages
on:
workflow_run:
workflows: ["CI"]
types: [completed]
jobs:
deploy:
if: github.event.workflow_run.conclusion != 'cancelled'
runs-on: ubuntu-latest
# Uncomment and configure if you need approval for deployments
# environment: gh-pages-approval
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4.3.1
with:
ref: gh-pages
fetch-depth: 0
- name: 📥 Download API reference artifact
uses: actions/download-artifact@v4.3.0
continue-on-error: true
with:
name: api-reference
path: ./artifacts/api-reference
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: 📥 Download pytest-html-report artifact
uses: actions/download-artifact@v4.3.0
continue-on-error: true
with:
name: pytest-html-report
path: ./artifacts/pytest-html-report
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: 📥 Download UI service playwright report artifact
uses: actions/download-artifact@v4.3.0
continue-on-error: true
with:
name: ui-service-playwright-report
path: ./artifacts/ui-service-playwright-report
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: 📥 Download UI HTML visual testing playwright report artifact
uses: actions/download-artifact@v4.3.0
continue-on-error: true
with:
name: ui-html-visual-testing-playwright-report
path: ./artifacts/ui-html-visual-testing-playwright-report
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
# this action exists in `gh-pages` branch
- name: 📚 Download Build and Deploy Artifacts
uses: ./.github/share-actions/build-and-deploy
- name: Build deployment link
if: github.event.workflow_run.event == 'pull_request'
id: link
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
run: |
PR_NUMBER=$(gh pr list --repo "$REPOSITORY" --head "$BRANCH_NAME" --json number --jq '.[0].number')
BRANCH_NAME="${BRANCH_NAME//\//-}"
if [ -n "$PR_NUMBER" ]; then
echo "pr_number=${PR_NUMBER}" >> $GITHUB_OUTPUT
echo "pages_path=pr-${PR_NUMBER}-${BRANCH_NAME}" >> $GITHUB_OUTPUT
fi
- name: Comment on PR with deployment link
if: steps.link.outputs.pr_number
uses: marocchino/sticky-pull-request-comment@v2.9.4
with:
number: ${{ steps.link.outputs.pr_number }}
message: |
📚 Artifacts deployed to GitHub Pages: https://evidentlyai.github.io/evidently/ci/#${{ steps.link.outputs.pages_path }}