Merge pull request #4946 from marcduiker/remove-java-submodule #6341
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
| name: Azure Static Web App Root | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - v1.16 | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| branches: | |
| - v1.16 | |
| concurrency: | |
| # Cancel the previously triggered build for only PR build. | |
| group: website-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_and_deploy_job: | |
| name: Build Hugo Website | |
| if: github.event.action != 'closed' | |
| runs-on: ubuntu-latest | |
| env: | |
| SWA_BASE: 'proud-bay-0e9e0e81e' | |
| HUGO_ENV: production | |
| steps: | |
| - name: Checkout docs repo | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Setup Hugo | |
| uses: peaceiris/[email protected] | |
| with: | |
| hugo-version: 0.147.9 | |
| extended: true | |
| - name: Setup Submodules | |
| run: | | |
| cd daprdocs | |
| git submodule update --init --recursive | |
| cd .. | |
| sudo npm install -D --save autoprefixer | |
| sudo npm install -D --save postcss-cli | |
| - name: Build Hugo Website | |
| run: | | |
| git config --global --add safe.directory /github/workspace | |
| if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then | |
| STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.westus2.azurestaticapps.net/" | |
| fi | |
| hugo ${STAGING_URL+-b "$STAGING_URL"} --minify | |
| - name: Deploy docs site | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| action: "upload" | |
| app_location: "/daprdocs/public" | |
| output_location: "/" | |
| skip_app_build: true | |
| skip_deploy_on_missing_secrets: true | |
| close_staging_site: | |
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
| runs-on: ubuntu-latest | |
| name: Close Pull Request Job | |
| steps: | |
| - name: Close Pull Request | |
| id: closepullrequest | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} | |
| action: "close" | |
| skip_deploy_on_missing_secrets: true |