-
Notifications
You must be signed in to change notification settings - Fork 28
65 lines (57 loc) · 2.02 KB
/
pages.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: pages
on:
push:
branches:
- 'master'
pull_request:
types: [opened, synchronize, reopened]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 20
cache: yarn
- uses: rlespinasse/github-slug-action@v4
- name: Set destination dir
id: set_destination_dir
run: |
if [[ $GITHUB_REF_SLUG == 'master' ]]; then
echo "dir=" >> $GITHUB_OUTPUT
else
echo "dir=ref/$GITHUB_REF_SLUG" >> $GITHUB_OUTPUT
fi
- name: Create GitHub deployment
uses: chrnorm/[email protected]
id: deployment
with:
token: "${{ github.token }}"
environment-url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
environment: github-pages
- run: yarn install
- run: yarn build-storybook
- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static
destination_dir: ${{ steps.set_destination_dir.outputs.dir }}
keep_files: true
- name: Update deployment status (success)
if: success()
uses: chrnorm/[email protected]
with:
token: "${{ github.token }}"
environment-url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "success"
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/[email protected]
with:
token: "${{ github.token }}"
environment-url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "failure"