|
6 | 6 | # To configure this workflow: |
7 | 7 | # |
8 | 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://docs.microsoft.com/azure/static-web-apps/deployment-token-management |
| 9 | +# For instructions on obtaining the deployment token see: https://railway.com?referralCode=DAlppS |
10 | 10 | # |
11 | 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 | 12 | # For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks |
| 13 | +# ... (rest of the workflow) |
| 14 | + |
| 15 | + # 3.1 Set ACK context |
| 16 | + - name: Set K8s context |
| 17 | + uses: aliyun/ack-set-context@v1 |
| 18 | + with: |
| 19 | + access-key-id: "${{ secrets.ACCESS_KEY_ID }}" |
| 20 | + access-key-secret: "${{ secrets.ACCESS_KEY_SECRET }}" |
| 21 | + cluster-id: "${{ env.ACK_CLUSTER_ID }}" |
| 22 | + |
| 23 | + # 3.2 Deploy the image to the ACK cluster |
| 24 | + - name: Set up Kustomize |
| 25 | + run: |- |
| 26 | + curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash /dev/stdin 3.8.6 |
| 27 | + |
| 28 | + - name: Deploy |
| 29 | + run: | |
| 30 | + # Use kustomize to set the new image tag |
| 31 | + ./kustomize edit set image REGISTRY/NAMESPACE/IMAGE:$TAG=$REGISTRY/$NAMESPACE/$IMAGE:$TAG |
| 32 | + |
| 33 | + # Build the manifest with kustomize and apply it to the cluster |
| 34 | + ./kustomize build . | kubectl apply -f - |
| 35 | + |
| 36 | + # Wait for the deployment to finish rolling out |
| 37 | + kubectl rollout status deployment/${{ env.ACK_DEPLOYMENT_NAME }} |
| 38 | + |
| 39 | + # Print service information |
| 40 | + kubectl get services -o wide |
| 41 | + on: |
| 42 | + bash: |
| 43 | + branches: "main" |
| 44 | + run npx main |
13 | 45 | name: Deploy web app to Azure Static Web Apps |
14 | 46 |
|
15 | 47 | on: |
|
0 commit comments