Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dev1#106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
stacyhaha wants to merge21 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromstacyhaha:dev1
Open

Dev1#106

Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
119ecab
Add or update the Azure App Service build and deployment workflow config
stacyhahaDec 24, 2024
e1dce68
change the home page
Dec 24, 2024
70a5674
check main protection
Dec 24, 2024
ec31e47
v3 check protection
Dec 24, 2024
5ad0ab7
avoid bypass
Dec 24, 2024
6436b19
Create docker.yaml
stacyhahaDec 24, 2024
0cbbafd
Rename docker.yaml to docker.yml
stacyhahaDec 24, 2024
73d7351
Update docker.yml
stacyhahaDec 24, 2024
c20c1a5
从 Azure 门户添加或更新应用服务部署工作流配置。
stacyhahaDec 24, 2024
844f5e9
从 Azure 门户添加或更新应用服务部署工作流配置。
stacyhahaDec 24, 2024
97f2b79
Update dev1_cicd-docker.yml
stacyhahaDec 24, 2024
01f7ad8
Update dev1_cicd-docker.yml
stacyhahaDec 24, 2024
4b0d6fc
Update dev1_cicd-docker.yml
stacyhahaDec 24, 2024
0435111
从 Azure 门户添加或更新应用服务部署工作流配置。
stacyhahaDec 24, 2024
969e10d
从 Azure 门户添加或更新应用服务部署工作流配置。
stacyhahaDec 24, 2024
aabadfe
Update dev1_cicd-docker.yml
stacyhahaDec 24, 2024
2680187
Update dev1_docker-cicd.yml
stacyhahaDec 24, 2024
5e10f7c
Update dev1_docker-cicd.yml
stacyhahaDec 24, 2024
cc24579
Update dev1_docker-cicd.yml
stacyhahaDec 24, 2024
66b278b
Update dev1_docker-cicd.yml
stacyhahaDec 24, 2024
4f8a3e9
Update dev1_docker-cicd.yml
stacyhahaDec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions.github/workflows/dev1_cicd-docker.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
# 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@v3.3.0
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 }}'
53 changes: 53 additions & 0 deletions.github/workflows/dev1_docker-cicd.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
# 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@v3.3.0
with:
registry: 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/stacyhaha/python-sample-vscode-flask-tutorial/myapp:${{ 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 }}'
70 changes: 70 additions & 0 deletions.github/workflows/docker.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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:
- dev1

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 }}'
78 changes: 78 additions & 0 deletions.github/workflows/main_cicd-demo.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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'

2 changes: 1 addition & 1 deletionhello_app/templates/home.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,5 +3,5 @@
Home
{% endblock %}
{% block content %}
<p>Home page for the Visual Studio Code Flask tutorial.</p>
<p>avoid bypass check main protection:Home page for the Visual Studio Code Flask tutorial.</p>
{% endblock %}

[8]ページ先頭

©2009-2025 Movatter.jp