fix v9 storybook test workflow (#417) #241
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: build and deploy to fluentchartseval | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
permissions: | |
contents: read #This is required for actions/checkout | |
outputs: | |
skip_deploy: ${{ steps.set_skip_output.outputs.skip_deploy }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Skip if last commit is snapshot chore | |
id: skip_check | |
shell: bash | |
run: | | |
git fetch origin ${{ github.ref }} --depth=1 | |
last_msg=$(git log -1 --pretty=%B) | |
if [[ "$last_msg" == *"(chore) update react-charting snapshots"* || "$last_msg" == *"(chore) update react-charts snapshots"* ]]; then | |
echo "skip_job=true" >> $GITHUB_OUTPUT | |
else | |
echo "skip_job=false" >> $GITHUB_OUTPUT | |
fi | |
- name: yarn install, build, and test | |
run: | | |
cd apps/plotly_examples | |
yarn install | |
yarn build | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: node-app | |
path: apps/plotly_examples/build | |
- name: Set skip output for deploy | |
if: always() | |
run: echo "skip_deploy=${{ steps.skip_check.outputs.skip_job }}" >> $GITHUB_OUTPUT | |
id: set_skip_output | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: needs.build.outputs.skip_deploy != 'true' | |
permissions: | |
id-token: write #This is required for requesting the JWT | |
contents: read #This is required for actions/checkout | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: node-app | |
- name: Login to Azure | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_B92B0539D2FB4B13B3C2BF3836380051 }} | |
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_CD6B9D2724174DCDB4E21F2A3B84BA2C }} | |
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_A0C748A7FDB947D1892147A405E56AA6 }} | |
- name: 'Deploy to Azure Web App' | |
uses: azure/webapps-deploy@v3 | |
id: deploy-to-webapp | |
with: | |
app-name: 'fluentchartseval' | |
slot-name: 'Production' | |
package: . | |