-
Notifications
You must be signed in to change notification settings - Fork 166
42 lines (36 loc) · 1.19 KB
/
pr-percy-copy-diff-files.yml
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
name: "Upload artifacts for Percy screenshots"
on:
pull_request:
branches:
- main
jobs:
copy_artifact:
name: Copy changed files to GHA artifact
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
sparse-checkout: |
templates/docs/examples/
scss/
- name: Make artifact directory
run: mkdir -p artifact
# Archive the PR number associated with this workflow since it won't be available in the base workflow context
# https://github.com/orgs/community/discussions/25220
- name: Archive PR data
if: github.event_name=='pull_request'
working-directory: artifact
run: |
echo ${{ github.event.number }} > pr_num.txt
echo ${{ github.event.pull_request.head.sha }} > pr_head_sha.txt
- name: Compress artifact
working-directory: artifact
run: |
cp -R ../templates/docs/examples/ ../scss/ .
tar -czf build.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "web-artifact-${{ github.run_id }}"
path: artifact/build.tar.gz