diff --git a/.github/workflows/workflow-cd-azure.yml b/.github/workflows/workflow-cd-azure.yml new file mode 100644 index 0000000..4ef91ae --- /dev/null +++ b/.github/workflows/workflow-cd-azure.yml @@ -0,0 +1,15 @@ +name: Workflow CD Azure +on: + workflow_dispatch: +permissions: + contents: read +jobs: + deployment: + runs-on: ubuntu-latest + steps: + - name: Azure Static Web Apps Deploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_TOKEN_SSG }} + app_location: "/public" + action: "upload" diff --git a/.github/workflows/workflow-cd.yml b/.github/workflows/workflow-cd.yml new file mode 100644 index 0000000..7b8dabf --- /dev/null +++ b/.github/workflows/workflow-cd.yml @@ -0,0 +1,31 @@ +name: Workflow CD +description: Testing a workflow CD +on: pull_request +permissions: + contents: read +jobs: + deployment: + runs-on: ubuntu-latest + environment: "Development" + steps: + - name: Azure Login + uses: Azure/login@v2.3.0 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - uses: azure/docker-login@v2 + with: + login-server: ${{env.IMAGE_REGISTRY_URL}} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy web app container + uses: Azure/webapps-deploy@v2.2.17 + with: + app-name: ${{env.AZURE_WEBAPP_NAME}} + images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}}:${{ github.sha }} + + - name: Azure logout + run: | + az logout + diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index 84675ea..184b869 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -2,13 +2,14 @@ name: Workflow CI description: A workflow that calls reusable and composite workflows permissions: contents: read -on: [pull_request] +on: [push, pull_request] jobs: call-reusable-workflow: uses: ./.github/workflows/reusable-workflow-for-ci.yml call-composite-workflow: runs-on: ubuntu-latest + environment: Development steps: - name: Checkout repository uses: actions/checkout@v4 @@ -16,5 +17,5 @@ jobs: - name: Call Greeting Workflow uses: ./.github/workflows/utilities/composite-workflow with: - name: "Desarrollador" + name: "Environment: ${{ vars.ENVIRONMENT_NAME }}" message: "Hola" diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..f2e75e7 --- /dev/null +++ b/public/index.html @@ -0,0 +1,11 @@ + + + + + + Document + + +

Deployment Actions with Azure

+ +