|
1 | | -# This workflow will build and push a web application to an Azure Static Web App when you change your code. |
2 | | -# |
3 | | -# This workflow assumes you have already created the target Azure Static Web App. |
4 | | -# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript |
5 | | -# |
6 | | -# To configure this workflow: |
7 | | -# |
8 | | -# 1. Set up a secret in your repository named AZURE_STATIC_WEB_APPS_API_TOKEN with the value of your Static Web Apps deployment token. |
9 | | -# For instructions on obtaining the deployment token see: https://railway.com?referralCode=DAlppS |
10 | | -# |
11 | | -# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). |
12 | | -# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks |
13 | 1 | # ... (rest of the workflow) |
14 | 2 |
|
15 | 3 | # 3.1 Set ACK context |
|
38 | 26 | |
39 | 27 | # Print service information |
40 | 28 | kubectl get services -o wide |
41 | | - on: |
42 | | - bash: |
43 | | - branches: "main" |
44 | | - run npx main |
45 | | -name: Deploy web app to Azure Static Web Apps |
46 | | - |
47 | | -on: |
48 | | - push: |
49 | | - branches: [ "main" ] |
50 | | - pull_request: |
51 | | - types: [opened, synchronize, reopened, closed] |
52 | | - branches: [ "main" ] |
53 | | - |
54 | | -# Environment variables available to all jobs and steps in this workflow |
55 | | -env: |
56 | | - APP_LOCATION: "/" # location of your client code |
57 | | - API_LOCATION: "api" # location of your api source code - optional |
58 | | - APP_ARTIFACT_LOCATION: "build" # location of client code build output |
59 | | - AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app |
60 | | - |
61 | | -permissions: |
62 | | - contents: read |
63 | | - |
64 | | -jobs: |
65 | | - build_and_deploy_job: |
66 | | - permissions: |
67 | | - contents: read # for actions/checkout to fetch code |
68 | | - pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs |
69 | | - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') |
70 | | - runs-on: ubuntu-latest |
71 | | - name: Build and Deploy Job |
72 | | - steps: |
73 | | - - uses: actions/checkout@v4 |
74 | | - with: |
75 | | - submodules: true |
76 | | - - name: Build And Deploy |
77 | | - id: builddeploy |
78 | | - uses: Azure/static-web-apps-deploy@v1 |
79 | | - with: |
80 | | - azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app |
81 | | - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) |
82 | | - action: "upload" |
83 | | - ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### |
84 | | - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig |
85 | | - app_location: ${{ env.APP_LOCATION }} |
86 | | - api_location: ${{ env.API_LOCATION }} |
87 | | - app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} |
88 | | - ###### End of Repository/Build Configurations ###### |
89 | | - |
90 | | - close_pull_request_job: |
91 | | - permissions: |
92 | | - contents: none |
93 | 29 | if: github.event_name == 'pull_request' && github.event.action == 'closed' |
94 | 30 | runs-on: ubuntu-latest |
95 | 31 | name: Close Pull Request Job |
|
0 commit comments