Merge pull request #1313 from SierraSoftworks/dependabot/npm_and_yarn… #984
This file contains 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
name: Documentation | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
paths: | |
- docs/**/* | |
jobs: | |
build: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build (Docs) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Install Dependencies | |
run: cd docs && npm ci | |
- name: Build | |
run: cd docs && npm run build | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: docs/.vuepress/dist | |
deploy: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
needs: build | |
name: Deploy to Azure Static Web Apps | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: dist | |
- name: Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_WEBSITES_TOKEN }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
app_location: "/dist" | |
api_location: "" | |
skip_app_build: true | |
cleanup: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Close Pull Request | |
steps: | |
- name: Close Pull Request | |
id: closepullrequest | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_WEBSITES_TOKEN }} | |
action: "close" |