azuregithubazure-web-app-service

Azure Static Web App with Git Actions [Git Actions error]


I'm trying to host my personal portfolio website with Azure Cloud(Static Web Actions) and I'm facing an error from Git Actions.

my yaml file - https://github.com/OfficialCodeVoyage/pavlobondarenko.co/blob/pushtoazure/.github/workflows/azure-static-web-apps-lively-ocean-008ed2910.yml

repo - https://github.com/OfficialCodeVoyage/pavlobondarenko.co/tree/pushtoazure

error 1

error 2

Tried changing .yaml file removed dokerfile removed php call for now

Thank you in advance!


Solution

  • I tried your code, made few changes, and was able to deploy the app to Azure Static web app via GitHub actions.

    This is my .yml file :

    name: Azure Static Web Apps CI/CD
    
    on:
      push:
        branches:
          - master
      pull_request:
        types: [opened, synchronize, reopened, closed]
        branches:
          - master
    
    jobs:
      build_and_deploy_job:
        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@v3
            with:
              submodules: true
              lfs: false
          - name: Build And Deploy
            id: builddeploy
            uses: Azure/static-web-apps-deploy@v1
            with:
              azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_ROCK_062CA360F }}
              repo_token: ${{ secrets.GITHUB_TOKEN }} 
              action: "upload"
              app_location: "/"
              api_location: ""
              output_location: "." 
    
      close_pull_request_job:
        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_POLITE_ROCK_062CA360F }}
              action: "close"
    

    I deployed the app through Github.

    enter image description here

    This is local output:

    enter image description here

    Here's the output after deployment:

    enter image description here