From 119ecab91ef7895a93ded6bd3f782cba85da65d6 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 19:56:15 +0800 Subject: [PATCH 01/21] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_cicd-demo.yml | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main_cicd-demo.yml diff --git a/.github/workflows/main_cicd-demo.yml b/.github/workflows/main_cicd-demo.yml new file mode 100644 index 000000000..75827a7f4 --- /dev/null +++ b/.github/workflows/main_cicd-demo.yml @@ -0,0 +1,78 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions +# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions + +name: Build and deploy Python app to Azure Web App - cicd-demo + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Create and start virtual environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: pip install -r requirements.txt + + # Optional: Add step to run tests here (PyTest, Django test suites, etc.) + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment jobs + uses: actions/upload-artifact@v4 + with: + name: python-app + path: | + release.zip + !venv/ + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: python-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5FB268B98CFE44E0BEEED5F540A2839B }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3EBFE7E2825942458DDF8947751539A7 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4C16A9EE9B4845589A178E3565C8667A }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'cicd-demo' + slot-name: 'Production' + \ No newline at end of file From e1dce6827399bae6811f04dba69be3068c38a0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=80=A1?= Date: Tue, 24 Dec 2024 20:45:15 +0800 Subject: [PATCH 02/21] change the home page --- hello_app/templates/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_app/templates/home.html b/hello_app/templates/home.html index 95609fecd..bd26bdd10 100644 --- a/hello_app/templates/home.html +++ b/hello_app/templates/home.html @@ -3,5 +3,5 @@ Home {% endblock %} {% block content %} -

Home page for the Visual Studio Code Flask tutorial.

+

version 2: Home page for the Visual Studio Code Flask tutorial.

{% endblock %} From 70a56745b687ed4df15b2f7b48a3236ed6c1e70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=80=A1?= Date: Tue, 24 Dec 2024 21:08:38 +0800 Subject: [PATCH 03/21] check main protection --- hello_app/templates/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_app/templates/home.html b/hello_app/templates/home.html index bd26bdd10..fb707b00e 100644 --- a/hello_app/templates/home.html +++ b/hello_app/templates/home.html @@ -3,5 +3,5 @@ Home {% endblock %} {% block content %} -

version 2: Home page for the Visual Studio Code Flask tutorial.

+

check main protection: Home page for the Visual Studio Code Flask tutorial.

{% endblock %} From ec31e479da81b41319041fafae7daaa11961b50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=80=A1?= Date: Tue, 24 Dec 2024 21:11:16 +0800 Subject: [PATCH 04/21] v3 check protection --- hello_app/templates/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_app/templates/home.html b/hello_app/templates/home.html index fb707b00e..bd903501b 100644 --- a/hello_app/templates/home.html +++ b/hello_app/templates/home.html @@ -3,5 +3,5 @@ Home {% endblock %} {% block content %} -

check main protection: Home page for the Visual Studio Code Flask tutorial.

+

v3 check main protection: Home page for the Visual Studio Code Flask tutorial.

{% endblock %} From 5ad0ab77ab5e031c932eb2583aaeb13d0bd1c175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=80=A1?= Date: Tue, 24 Dec 2024 21:15:52 +0800 Subject: [PATCH 05/21] avoid bypass --- hello_app/templates/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hello_app/templates/home.html b/hello_app/templates/home.html index bd903501b..f62e6f432 100644 --- a/hello_app/templates/home.html +++ b/hello_app/templates/home.html @@ -3,5 +3,5 @@ Home {% endblock %} {% block content %} -

v3 check main protection: Home page for the Visual Studio Code Flask tutorial.

+

avoid bypass check main protection: Home page for the Visual Studio Code Flask tutorial.

{% endblock %} From 6436b19d5ae8dcb6c4b16627c07b1c26c37e711d Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:27:07 +0800 Subject: [PATCH 06/21] Create docker.yaml --- .github/workflows/docker.yaml | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/docker.yaml diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 000000000..da9a901b0 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,70 @@ +# 此工作流使用未经 GitHub 认证的操作。 +# 它们由第三方提供,并受 +# 单独的服务条款、隐私政策和支持 +# 文档。 + +# GitHub 建议将操作固定到提交 SHA。 +# 若要获取较新版本,需要更新 SHA。 +# 还可以引用标记或分支,但该操作可能会更改而不发出警告。 + +name: Build and deploy a container to an Azure Web App + +env: + AZURE_WEBAPP_NAME: cicd-docker # set this to your application's name + +on: + push: + branches: + - main + +permissions: + contents: 'read' + packages: 'write' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b + + - name: Log in to GitHub container registry + uses: docker/login-action@8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Lowercase the repo name + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + + - name: Build and push container image to registry + uses: docker/build-push-action@9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f + with: + push: true + tags: ghcr.io/${{ env.REPO }}:${{ github.sha }} + file: ./Dockerfile + + deploy: + runs-on: ubuntu-latest + + needs: build + + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Lowercase the repo name + run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@85270a1854658d167ab239bce43949edb336fa7c + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_DOCKER }} + images: 'ghcr.io/${{ env.REPO }}:${{ github.sha }}' From 0cbbafd3d7c71e51e75c13fe4a2fa138cc687be0 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:27:24 +0800 Subject: [PATCH 07/21] Rename docker.yaml to docker.yml --- .github/workflows/{docker.yaml => docker.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docker.yaml => docker.yml} (100%) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yml similarity index 100% rename from .github/workflows/docker.yaml rename to .github/workflows/docker.yml From 73d73519c6c5989e85622e4b318388f95d29a6b8 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:41:04 +0800 Subject: [PATCH 08/21] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index da9a901b0..66787a9ba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,7 +15,7 @@ env: on: push: branches: - - main + - dev1 permissions: contents: 'read' From c20c1a519fe48c433228ed16ce78e0ffe13e6f94 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:45:55 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E4=BB=8E=20Azure=20=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=96=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev1_cicd-docker.yml | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/dev1_cicd-docker.yml diff --git a/.github/workflows/dev1_cicd-docker.yml b/.github/workflows/dev1_cicd-docker.yml new file mode 100644 index 000000000..5ae485ea9 --- /dev/null +++ b/.github/workflows/dev1_cicd-docker.yml @@ -0,0 +1,51 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy container app to Azure Web App - cicd-docker + +on: + push: + branches: + - dev1 + workflow_dispatch: + +jobs: + build: + runs-on: 'ubuntu-latest' + + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to registry + uses: docker/login-action@v2 + with: + registry: https://ghcr.io / + username: ${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }} + password: ${{ secrets.AzureAppService_ContainerPassword_8e51194ff5ea4c38b91386c854241fbe }} + + - name: Build and push container image to registry + uses: docker/build-push-action@v3 + with: + push: true + tags: ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }} + file: ./Dockerfile + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'cicd-docker' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_6074368e92f4496ebf08ec0f8238e59f }} + images: 'ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }}' \ No newline at end of file From 844f5e9640596772fe8a1fde8cc73e6694049c6b Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:46:05 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E4=BB=8E=20Azure=20=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=96=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 97f2b7988e7e689efa9a2f009c23869a8441dd04 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:57:37 +0800 Subject: [PATCH 11/21] Update dev1_cicd-docker.yml --- .github/workflows/dev1_cicd-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev1_cicd-docker.yml b/.github/workflows/dev1_cicd-docker.yml index 5ae485ea9..b09fc80f0 100644 --- a/.github/workflows/dev1_cicd-docker.yml +++ b/.github/workflows/dev1_cicd-docker.yml @@ -22,7 +22,7 @@ jobs: - name: Log in to registry uses: docker/login-action@v2 with: - registry: https://ghcr.io / + registry: https://ghcr.io/ username: ${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }} password: ${{ secrets.AzureAppService_ContainerPassword_8e51194ff5ea4c38b91386c854241fbe }} @@ -48,4 +48,4 @@ jobs: app-name: 'cicd-docker' slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_6074368e92f4496ebf08ec0f8238e59f }} - images: 'ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }}' \ No newline at end of file + images: 'ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }}' From 01f7ad818bb1ff6e3073abf85bf9bad44e3335b5 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:58:22 +0800 Subject: [PATCH 12/21] Update dev1_cicd-docker.yml --- .github/workflows/dev1_cicd-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev1_cicd-docker.yml b/.github/workflows/dev1_cicd-docker.yml index b09fc80f0..8ce8e13d9 100644 --- a/.github/workflows/dev1_cicd-docker.yml +++ b/.github/workflows/dev1_cicd-docker.yml @@ -30,7 +30,7 @@ jobs: uses: docker/build-push-action@v3 with: push: true - tags: ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }} + tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }} file: ./Dockerfile deploy: From 4b0d6fc5538138470cc3ec293f75f044b7ddaabd Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:59:00 +0800 Subject: [PATCH 13/21] Update dev1_cicd-docker.yml --- .github/workflows/dev1_cicd-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev1_cicd-docker.yml b/.github/workflows/dev1_cicd-docker.yml index 8ce8e13d9..31460e20a 100644 --- a/.github/workflows/dev1_cicd-docker.yml +++ b/.github/workflows/dev1_cicd-docker.yml @@ -48,4 +48,4 @@ jobs: app-name: 'cicd-docker' slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_6074368e92f4496ebf08ec0f8238e59f }} - images: 'ghcr.io /${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }}' + images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }}/appsvc/staticsite:${{ github.sha }}' From 043511140dd078247e8898853f42569c4591ef6e Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:41:04 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E4=BB=8E=20Azure=20=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=96=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dev1_docker-cicd.yml | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/dev1_docker-cicd.yml diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml new file mode 100644 index 000000000..74a80a941 --- /dev/null +++ b/.github/workflows/dev1_docker-cicd.yml @@ -0,0 +1,51 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy container app to Azure Web App - docker-cicd + +on: + push: + branches: + - dev1 + workflow_dispatch: + +jobs: + build: + runs-on: 'ubuntu-latest' + + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to registry + uses: docker/login-action@v2 + with: + registry: https://ghcr.io/ + username: ${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }} + password: ${{ secrets.AzureAppService_ContainerPassword_4e4dafdefa504043a4aada246d62cf72 }} + + - name: Build and push container image to registry + uses: docker/build-push-action@v3 + with: + push: true + tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }} + file: ./Dockerfile + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'docker-cicd' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_e90c69f2bc964901a9a6348a135e00d5 }} + images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }}' \ No newline at end of file From 969e10dcf81f17011c60709b19360d0dc5e12202 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:41:18 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E4=BB=8E=20Azure=20=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=96=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From aabadfe8d507544eafe19df5cddfbc32706807af Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:58:02 +0800 Subject: [PATCH 16/21] Update dev1_cicd-docker.yml --- .github/workflows/dev1_cicd-docker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev1_cicd-docker.yml b/.github/workflows/dev1_cicd-docker.yml index 31460e20a..f329cd0ac 100644 --- a/.github/workflows/dev1_cicd-docker.yml +++ b/.github/workflows/dev1_cicd-docker.yml @@ -18,9 +18,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + + + - name: Log in to registry - uses: docker/login-action@v2 + uses: docker/login-action@v3.3.0 with: registry: https://ghcr.io/ username: ${{ secrets.AzureAppService_ContainerUsername_0662e63fa3694eeebfb3e991e27936ca }} From 2680187a464a52e4da391602b0323b08920e3f52 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Wed, 25 Dec 2024 00:01:11 +0800 Subject: [PATCH 17/21] Update dev1_docker-cicd.yml --- .github/workflows/dev1_docker-cicd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml index 74a80a941..4d91c2a9d 100644 --- a/.github/workflows/dev1_docker-cicd.yml +++ b/.github/workflows/dev1_docker-cicd.yml @@ -20,9 +20,9 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Log in to registry - uses: docker/login-action@v2 + uses: docker/login-action@v3.3.0 with: - registry: https://ghcr.io/ + registry: ghcr.io username: ${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }} password: ${{ secrets.AzureAppService_ContainerPassword_4e4dafdefa504043a4aada246d62cf72 }} @@ -48,4 +48,4 @@ jobs: app-name: 'docker-cicd' slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_e90c69f2bc964901a9a6348a135e00d5 }} - images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }}' \ No newline at end of file + images: 'ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }}' From 5e10f7ce911da01ee321a34d31b3d30d076413f6 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Wed, 25 Dec 2024 00:08:29 +0800 Subject: [PATCH 18/21] Update dev1_docker-cicd.yml --- .github/workflows/dev1_docker-cicd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml index 4d91c2a9d..3da9fb6f1 100644 --- a/.github/workflows/dev1_docker-cicd.yml +++ b/.github/workflows/dev1_docker-cicd.yml @@ -26,8 +26,10 @@ jobs: username: ${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }} password: ${{ secrets.AzureAppService_ContainerPassword_4e4dafdefa504043a4aada246d62cf72 }} + + - name: Build and push container image to registry - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6.10.0 with: push: true tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }} From cc24579e2cfdf8672b94f82c524b8ca39e649f26 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Wed, 25 Dec 2024 00:11:07 +0800 Subject: [PATCH 19/21] Update dev1_docker-cicd.yml --- .github/workflows/dev1_docker-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml index 3da9fb6f1..ae651573f 100644 --- a/.github/workflows/dev1_docker-cicd.yml +++ b/.github/workflows/dev1_docker-cicd.yml @@ -29,7 +29,7 @@ jobs: - name: Build and push container image to registry - uses: docker/build-push-action@v6.10.0 + uses: docker/build-push-action@v3 with: push: true tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }} From 66b278b5ae2a9c7c481f145ef337821d86b9d455 Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Wed, 25 Dec 2024 00:14:53 +0800 Subject: [PATCH 20/21] Update dev1_docker-cicd.yml --- .github/workflows/dev1_docker-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml index ae651573f..c21ae7849 100644 --- a/.github/workflows/dev1_docker-cicd.yml +++ b/.github/workflows/dev1_docker-cicd.yml @@ -32,7 +32,7 @@ jobs: uses: docker/build-push-action@v3 with: push: true - tags: ghcr.io/${{ secrets.AzureAppService_ContainerUsername_70e6045170104b8997d27697b11cdfd0 }}/appsvc/staticsite:${{ github.sha }} + tags: ghcr.io/stacyhaha/python-sample-vscode-flask-tutorial/appsvc/staticsite:${{ github.sha }} file: ./Dockerfile deploy: From 4f8a3e9df06fc3d10f3202c0d78c2cc5e6ca922b Mon Sep 17 00:00:00 2001 From: Stacy <49969718+stacyhaha@users.noreply.github.com> Date: Wed, 25 Dec 2024 00:16:39 +0800 Subject: [PATCH 21/21] Update dev1_docker-cicd.yml --- .github/workflows/dev1_docker-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev1_docker-cicd.yml b/.github/workflows/dev1_docker-cicd.yml index c21ae7849..f2e007410 100644 --- a/.github/workflows/dev1_docker-cicd.yml +++ b/.github/workflows/dev1_docker-cicd.yml @@ -32,7 +32,7 @@ jobs: uses: docker/build-push-action@v3 with: push: true - tags: ghcr.io/stacyhaha/python-sample-vscode-flask-tutorial/appsvc/staticsite:${{ github.sha }} + tags: ghcr.io/stacyhaha/python-sample-vscode-flask-tutorial/myapp:${{ github.sha }} file: ./Dockerfile deploy: