GitHub Actions에서 .NET Core 앱을 Azure에 배포
7734 단어 AzureGitHubActions.NETCore
소개
GitHub Actions에서 .NET Core 앱을 Azure App Service에 배포할 때까지 작성합니다.
워크플로 만들기
[new workflow]에서 .NET Core 선택

[set up this workflow]를 클릭하면 템플릿이 표시됩니다.
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
이 템플릿을 따라 변경합니다.
checkout
git submodules
를 사용하는 리포지토리에서 v2
에서는 submodules: true
가 지원되지 않았으므로 어쩔 수 없이 v1
를 이용했습니다.
+ - uses: actions/checkout@v1
+ with:
+ submodules: true
- - uses: actions/checkout@v2
submodules로 ssh라고 얻을 수 없기 때문에 https로 변경.
.gitmodules[submodule "..."]
path = repo
+ url = https://github.com/repo.git
- url = [email protected]:repo.git
setup-dotnet
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish "{path}" --configuration Release -o hoge
코드 포맷터
.NET Core에서는 dotnet format이라는 포맷터가 있다.
dotnet format
- name: Restore Tool
run: dotnet tool restore
- name: Check code format
run: dotnet format --check --dry-run
※ 매니페스트 파일이 없으면 dotnet tool 명령이 유효하지 않으므로주의. 도입은 이쪽 여기 이 참고가 된다고 생각합니다.
옵션
--check
: 포맷하지 않고 체크--dry-run
: 실패했을 때 0 이외의 종료 코드를 돌려줍니다.
webapps-deploy
Azure에 배포하기 위한 워크플로 배포하기 위한 자격 증명을 가져와야 하기 때문에 게시 프로필 가져오기를 누릅니다. github의 Secret에서 publish_profile
의 이름(이름은 무엇이든 좋다)으로 다운로드한 파일을 아래에서 붙여넣기. package는 dotnet publish로 출력한 디렉토리를 지정한다.

Secret로 등록한 key를 publish-profile
로 지정한다.
- uses: azure/webapps-deploy@v1
with:
publish-profile: ${{ secrets.publish_profile }}
package: './hoge'
마스터에 푸시되면 자동 배포
push:
branches: [ master ]
이런 식으로 워크 플로가 실행된다고 생각합니다.

AppService 설정
[배포 센터]에서 github를 누르십시오

github actions 선택
아직 미리보기입니다 orz

배포할 리포지토리를 입력합니다. 워크플로가 깔끔해졌으므로 [기존 워크플로 정의를 사용하여 구성]을 선택합니다. 신규로 만들면 샘플을 마음대로 커밋되기 때문에 그만둡시다 (MS는 필요없는 절개가 많은 생각이 ..)

완료되면 나머지는 push하고 워크플로 흘리면 배포 완료.
Azure에서는 kudu라는 배포 엔진이 사용되었지만 마침내 괜찮은 CI가 지원되어 사용하기 쉽습니다.
AppSercve on Linux의 B1 인스턴스를 이용하고 있습니다만, master에 병합되면 고확률로 실패한다. . 재시도하면 배포 할 수 있지만,
참고
Deploy .NET Core web application using GitHub Actions
Reference
이 문제에 관하여(GitHub Actions에서 .NET Core 앱을 Azure에 배포), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ikuosaito1989/items/1baf18c739d332f41411
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
[new workflow]에서 .NET Core 선택

[set up this workflow]를 클릭하면 템플릿이 표시됩니다.
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
이 템플릿을 따라 변경합니다.
checkout
git submodules
를 사용하는 리포지토리에서 v2
에서는 submodules: true
가 지원되지 않았으므로 어쩔 수 없이 v1
를 이용했습니다.
+ - uses: actions/checkout@v1
+ with:
+ submodules: true
- - uses: actions/checkout@v2
submodules로 ssh라고 얻을 수 없기 때문에 https로 변경.
.gitmodules[submodule "..."]
path = repo
+ url = https://github.com/repo.git
- url = [email protected]:repo.git
setup-dotnet
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish "{path}" --configuration Release -o hoge
코드 포맷터
.NET Core에서는 dotnet format이라는 포맷터가 있다.
dotnet format
- name: Restore Tool
run: dotnet tool restore
- name: Check code format
run: dotnet format --check --dry-run
※ 매니페스트 파일이 없으면 dotnet tool 명령이 유효하지 않으므로주의. 도입은 이쪽 여기 이 참고가 된다고 생각합니다.
옵션
--check
: 포맷하지 않고 체크--dry-run
: 실패했을 때 0 이외의 종료 코드를 돌려줍니다.
webapps-deploy
Azure에 배포하기 위한 워크플로 배포하기 위한 자격 증명을 가져와야 하기 때문에 게시 프로필 가져오기를 누릅니다. github의 Secret에서 publish_profile
의 이름(이름은 무엇이든 좋다)으로 다운로드한 파일을 아래에서 붙여넣기. package는 dotnet publish로 출력한 디렉토리를 지정한다.

Secret로 등록한 key를 publish-profile
로 지정한다.
- uses: azure/webapps-deploy@v1
with:
publish-profile: ${{ secrets.publish_profile }}
package: './hoge'
마스터에 푸시되면 자동 배포
push:
branches: [ master ]
이런 식으로 워크 플로가 실행된다고 생각합니다.

AppService 설정
[배포 센터]에서 github를 누르십시오

github actions 선택
아직 미리보기입니다 orz

배포할 리포지토리를 입력합니다. 워크플로가 깔끔해졌으므로 [기존 워크플로 정의를 사용하여 구성]을 선택합니다. 신규로 만들면 샘플을 마음대로 커밋되기 때문에 그만둡시다 (MS는 필요없는 절개가 많은 생각이 ..)

완료되면 나머지는 push하고 워크플로 흘리면 배포 완료.
Azure에서는 kudu라는 배포 엔진이 사용되었지만 마침내 괜찮은 CI가 지원되어 사용하기 쉽습니다.
AppSercve on Linux의 B1 인스턴스를 이용하고 있습니다만, master에 병합되면 고확률로 실패한다. . 재시도하면 배포 할 수 있지만,
참고
Deploy .NET Core web application using GitHub Actions
Reference
이 문제에 관하여(GitHub Actions에서 .NET Core 앱을 Azure에 배포), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ikuosaito1989/items/1baf18c739d332f41411
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
+ - uses: actions/checkout@v1
+ with:
+ submodules: true
- - uses: actions/checkout@v2
[submodule "..."]
path = repo
+ url = https://github.com/repo.git
- url = [email protected]:repo.git
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.100
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet publish "{path}" --configuration Release -o hoge
코드 포맷터
.NET Core에서는 dotnet format이라는 포맷터가 있다.
dotnet format
- name: Restore Tool
run: dotnet tool restore
- name: Check code format
run: dotnet format --check --dry-run
※ 매니페스트 파일이 없으면 dotnet tool 명령이 유효하지 않으므로주의. 도입은 이쪽 여기 이 참고가 된다고 생각합니다.
옵션
--check
: 포맷하지 않고 체크--dry-run
: 실패했을 때 0 이외의 종료 코드를 돌려줍니다.webapps-deploy
Azure에 배포하기 위한 워크플로 배포하기 위한 자격 증명을 가져와야 하기 때문에 게시 프로필 가져오기를 누릅니다. github의 Secret에서 publish_profile
의 이름(이름은 무엇이든 좋다)으로 다운로드한 파일을 아래에서 붙여넣기. package는 dotnet publish로 출력한 디렉토리를 지정한다.

Secret로 등록한 key를 publish-profile
로 지정한다.
- uses: azure/webapps-deploy@v1
with:
publish-profile: ${{ secrets.publish_profile }}
package: './hoge'
마스터에 푸시되면 자동 배포
push:
branches: [ master ]
이런 식으로 워크 플로가 실행된다고 생각합니다.

AppService 설정
[배포 센터]에서 github를 누르십시오

github actions 선택
아직 미리보기입니다 orz

배포할 리포지토리를 입력합니다. 워크플로가 깔끔해졌으므로 [기존 워크플로 정의를 사용하여 구성]을 선택합니다. 신규로 만들면 샘플을 마음대로 커밋되기 때문에 그만둡시다 (MS는 필요없는 절개가 많은 생각이 ..)

완료되면 나머지는 push하고 워크플로 흘리면 배포 완료.
Azure에서는 kudu라는 배포 엔진이 사용되었지만 마침내 괜찮은 CI가 지원되어 사용하기 쉽습니다.
AppSercve on Linux의 B1 인스턴스를 이용하고 있습니다만, master에 병합되면 고확률로 실패한다. . 재시도하면 배포 할 수 있지만,
참고
Deploy .NET Core web application using GitHub Actions
Reference
이 문제에 관하여(GitHub Actions에서 .NET Core 앱을 Azure에 배포), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ikuosaito1989/items/1baf18c739d332f41411
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
- uses: azure/webapps-deploy@v1
with:
publish-profile: ${{ secrets.publish_profile }}
package: './hoge'
push:
branches: [ master ]
이런 식으로 워크 플로가 실행된다고 생각합니다.

AppService 설정
[배포 센터]에서 github를 누르십시오

github actions 선택
아직 미리보기입니다 orz

배포할 리포지토리를 입력합니다. 워크플로가 깔끔해졌으므로 [기존 워크플로 정의를 사용하여 구성]을 선택합니다. 신규로 만들면 샘플을 마음대로 커밋되기 때문에 그만둡시다 (MS는 필요없는 절개가 많은 생각이 ..)

완료되면 나머지는 push하고 워크플로 흘리면 배포 완료.
Azure에서는 kudu라는 배포 엔진이 사용되었지만 마침내 괜찮은 CI가 지원되어 사용하기 쉽습니다.
AppSercve on Linux의 B1 인스턴스를 이용하고 있습니다만, master에 병합되면 고확률로 실패한다. . 재시도하면 배포 할 수 있지만,
참고
Deploy .NET Core web application using GitHub Actions
Reference
이 문제에 관하여(GitHub Actions에서 .NET Core 앱을 Azure에 배포), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/ikuosaito1989/items/1baf18c739d332f41411
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Deploy .NET Core web application using GitHub Actions
Reference
이 문제에 관하여(GitHub Actions에서 .NET Core 앱을 Azure에 배포), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ikuosaito1989/items/1baf18c739d332f41411텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)