Skip to content

Commit

Permalink
chore(ci): add gh deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
irudoy committed Aug 3, 2021
1 parent e59ea8e commit 51ccbbd
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
node-version: 12
cache: yarn
- uses: rlespinasse/github-slug-action@v3.x
- run: yarn install
- run: yarn build-storybook

- name: Set destination dir
id: set_destination_dir
run: |
Expand All @@ -22,10 +21,42 @@ jobs:
else
echo "::set-output name=dir::$GITHUB_REF_SLUG"
fi
- name: Create GitHub deployment
uses: chrnorm/deployment-action@v1.2.0
id: deployment
with:
token: "${{ github.token }}"
target_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/actions-gh-pages@v3.8.0
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/deployment-status@v1.0.0
with:
token: "${{ github.token }}"
target_url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
environment_url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v1.0.0
with:
token: "${{ github.token }}"
target_url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
environment_url: https://dromru.github.io/react-photoswipe-gallery/${{ steps.set_destination_dir.outputs.dir }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

0 comments on commit 51ccbbd

Please sign in to comment.