From e802715beea240309c862d29f1c1997c47408653 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 22:32:41 -0500 Subject: [PATCH 1/9] feat: add environment --- .github/workflows/workflow-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index 84675ea..fc54f56 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -2,13 +2,15 @@ name: Workflow CI description: A workflow that calls reusable and composite workflows permissions: contents: read -on: [pull_request] +on: [push] jobs: call-reusable-workflow: uses: ./.github/workflows/reusable-workflow-for-ci.yml call-composite-workflow: + if: ${{ vars.CAN_EXECUTE_COMPOSITE_WORKFLOW == 'true' }} runs-on: ubuntu-latest + environment: Development steps: - name: Checkout repository uses: actions/checkout@v4 From 9ecdb435b0881cdafc5b69daedc8a981ed0c361f Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 23:04:48 -0500 Subject: [PATCH 2/9] feat: add new event --- .github/workflows/workflow-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index fc54f56..fcbdd52 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -2,7 +2,7 @@ name: Workflow CI description: A workflow that calls reusable and composite workflows permissions: contents: read -on: [push] +on: [push, pull_request] jobs: call-reusable-workflow: uses: ./.github/workflows/reusable-workflow-for-ci.yml From 3b133cd3538a3344b871b5e856747371eb87fc15 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 23:12:24 -0500 Subject: [PATCH 3/9] fix: remove conditional --- .github/workflows/workflow-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index fcbdd52..6e3c98b 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -8,7 +8,6 @@ jobs: uses: ./.github/workflows/reusable-workflow-for-ci.yml call-composite-workflow: - if: ${{ vars.CAN_EXECUTE_COMPOSITE_WORKFLOW == 'true' }} runs-on: ubuntu-latest environment: Development steps: @@ -18,5 +17,5 @@ jobs: - name: Call Greeting Workflow uses: ./.github/workflows/utilities/composite-workflow with: - name: "Desarrollador" + name: ${{ vars.ENVIRONMENT_NAME }} message: "Hola" From a5b76f556bec5dfd366a9492930feeebc6ca5463 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 23:23:05 -0500 Subject: [PATCH 4/9] feat: add text --- .github/workflows/workflow-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index 6e3c98b..d77be7c 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -17,5 +17,5 @@ jobs: - name: Call Greeting Workflow uses: ./.github/workflows/utilities/composite-workflow with: - name: ${{ vars.ENVIRONMENT_NAME }} + name: environment ${{ vars.ENVIRONMENT_NAME }} message: "Hola" From db3d01d3870aeddae3289e3ed9e49f24345fc246 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 23:27:21 -0500 Subject: [PATCH 5/9] feat: update text --- .github/workflows/workflow-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index d77be7c..2153386 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -17,5 +17,5 @@ jobs: - name: Call Greeting Workflow uses: ./.github/workflows/utilities/composite-workflow with: - name: environment ${{ vars.ENVIRONMENT_NAME }} + name: "environment: ${{ vars.ENVIRONMENT_NAME }}" message: "Hola" From a175b14a4fba3f7534605278e8d851d8c7021c8e Mon Sep 17 00:00:00 2001 From: chrisdca Date: Tue, 23 Sep 2025 23:32:35 -0500 Subject: [PATCH 6/9] feat: update text environment --- .github/workflows/workflow-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-ci.yml b/.github/workflows/workflow-ci.yml index 2153386..184b869 100644 --- a/.github/workflows/workflow-ci.yml +++ b/.github/workflows/workflow-ci.yml @@ -17,5 +17,5 @@ jobs: - name: Call Greeting Workflow uses: ./.github/workflows/utilities/composite-workflow with: - name: "environment: ${{ vars.ENVIRONMENT_NAME }}" + name: "Environment: ${{ vars.ENVIRONMENT_NAME }}" message: "Hola" From 53b3e9bbde988eaecd70643234022e908ceb355a Mon Sep 17 00:00:00 2001 From: chrisdca Date: Wed, 24 Sep 2025 10:49:23 -0500 Subject: [PATCH 7/9] feat: add workflow CD --- .github/workflows/workflow-cd.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/workflow-cd.yml diff --git a/.github/workflows/workflow-cd.yml b/.github/workflows/workflow-cd.yml new file mode 100644 index 0000000..46045bd --- /dev/null +++ b/.github/workflows/workflow-cd.yml @@ -0,0 +1,22 @@ +name: Workflow CD +description: Testing a workflow CD +on: push +permissions: + contents: read +jobs: + deployment: + runs-on: ubuntu-latest + environment: "Development" + steps: + - name: Crear deployment + uses: actions/github-script@v8 + with: + script: | + github.rest.repos.createDeployment({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: context.ref, + environment: 'Development', + auto_merge: false, + required_contexts: [] + }) From f14f1237e9c916d07165ef71f94c71cf18bbca28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20D=C3=ADaz?= <164126437+christianncode@users.noreply.github.com> Date: Sun, 28 Sep 2025 20:31:46 -0500 Subject: [PATCH 8/9] Update workflow-cd.yml --- .github/workflows/workflow-cd.yml | 33 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/workflow-cd.yml b/.github/workflows/workflow-cd.yml index 46045bd..7b8dabf 100644 --- a/.github/workflows/workflow-cd.yml +++ b/.github/workflows/workflow-cd.yml @@ -1,6 +1,6 @@ name: Workflow CD description: Testing a workflow CD -on: push +on: pull_request permissions: contents: read jobs: @@ -8,15 +8,24 @@ jobs: runs-on: ubuntu-latest environment: "Development" steps: - - name: Crear deployment - uses: actions/github-script@v8 + - name: Azure Login + uses: Azure/login@v2.3.0 with: - script: | - github.rest.repos.createDeployment({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: context.ref, - environment: 'Development', - auto_merge: false, - required_contexts: [] - }) + 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 + From 640cdf949480ca9c0ebbdf21fdf0762b4b835e30 Mon Sep 17 00:00:00 2001 From: chrisdca Date: Mon, 29 Sep 2025 23:43:57 -0500 Subject: [PATCH 9/9] feat: add workflow azure CD --- .github/workflows/workflow-cd-azure.yml | 15 +++++++++++++++ public/index.html | 11 +++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/workflow-cd-azure.yml create mode 100644 public/index.html 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/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

+ +