認証の方針と表現を統一 (#1851) #1257
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cspell:ignore endgroup fjogeleit markdownlint softprops textlintrc webapps | |
name: ドキュメントのビルドとリリース | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-Beta[0-9]+' | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
env: | |
APP_ALESINFINY_MAIA_WEBAPP_NAME: app-alesinfiny-maia-docs-prod | |
DOCUMENT_BASE_PATH: documents | |
DOCUMENT_OUTPUT_FOLDER_NAME: build-artifacts | |
DOCUMENT_ARTIFACTS_FILENAME: docs.zip | |
COMPRESSED_SOURCE_PATH: contents/samples/downloads | |
jobs: | |
build: | |
name: ドキュメントのビルド | |
runs-on: ubuntu-latest | |
outputs: | |
is_pre_release: ${{ steps.setup-variables.outputs.is_pre_release }} | |
steps: | |
- id: setup-variables | |
name: 変数の初期化 | |
run: | | |
pre_release=false | |
if [[ "${{ github.ref_name }}" == *"Beta"* ]]; then | |
pre_release=true | |
fi | |
echo "is_pre_release:$pre_release" | |
echo "is_pre_release=$pre_release" >> $GITHUB_ENV | |
echo "is_pre_release=$pre_release" >> $GITHUB_OUTPUT | |
- name: ブランチのチェックアウト | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: lint-documents | |
name: ドキュメントの Lint | |
continue-on-error: true | |
uses: ./.github/workflows/lint-documents | |
- name: サンプルアプリケーションのソースコード圧縮 | |
uses: ./.github/workflows/compress-sample-source | |
with: | |
compressed-source-path: ${{ env.DOCUMENT_BASE_PATH }}/${{ env.COMPRESSED_SOURCE_PATH }} | |
- name: ドキュメントのビルド | |
uses: ./.github/workflows/build-documents | |
with: | |
document-base-path: ${{ env.DOCUMENT_BASE_PATH }} | |
output-folder-name: ${{ env.DOCUMENT_OUTPUT_FOLDER_NAME }} | |
- name: Lint結果の成否判定 | |
if: steps.lint-documents.outcome == 'failure' | |
run: | | |
exit 1; | |
- name: ビルドアーティファクトのパッケージングとアップロード | |
uses: ./.github/workflows/pack-and-upload | |
with: | |
packaging-folder-path: ${{ env.DOCUMENT_BASE_PATH }}/${{ env.DOCUMENT_OUTPUT_FOLDER_NAME }} | |
document-artifact-path: ${{ env.DOCUMENT_BASE_PATH }}/${{ env.DOCUMENT_ARTIFACTS_FILENAME }} | |
release-github: | |
name: Githubのリリース | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: ビルドアーティファクトのダウンロード | |
uses: actions/download-artifact@v4 | |
with: | |
name: documents | |
- name: Githubのリリース | |
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1 | |
with: | |
files: ${{ env.DOCUMENT_ARTIFACTS_FILENAME }} | |
generate_release_notes: true | |
prerelease: ${{ needs.build.outputs.is_pre_release }} | |
release-documents: | |
name: ドキュメントのリリース | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: ビルドアーティファクトのダウンロード | |
uses: actions/download-artifact@v4 | |
with: | |
name: documents | |
- name: Azure に OIDC Login | |
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: ステージング環境へのデプロイ | |
uses: azure/webapps-deploy@de617f46172a906d0617bb0e50d81e9e3aec24c8 # v3.0.1 | |
with: | |
app-name: ${{ env.APP_ALESINFINY_MAIA_WEBAPP_NAME }} | |
slot-name: staging | |
package: "${{ env.DOCUMENT_ARTIFACTS_FILENAME }}" | |
- name: Teams への通知 | |
uses: fjogeleit/http-request-action@23ad54bcd1178fcff6a0d17538fa09de3a7f0a4d # v1.16.4 | |
with: | |
url: ${{ secrets.ALESINFINY_POST_MESSAGE_TO_TEAMS_URL }} | |
method: POST | |
contentType: application/json | |
data: '{"messageType": 0,"branchName": "${{ github.ref }}","actor": "${{ github.actor }}","sha": "${{ github.sha }}","eventName": "${{ github.event_name }}"}' | |
timeout: 30000 | |
swap: | |
name: 本番環境への反映承認 | |
needs: [build, release-github, release-documents] | |
if: needs.build.outputs.is_pre_release == 'false' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: 本番環境への反映承認 | |
uses: fjogeleit/http-request-action@23ad54bcd1178fcff6a0d17538fa09de3a7f0a4d # v1.16.4 | |
with: | |
url: ${{ secrets.ALESINFINY_APPROVE_REQUEST_TO_TEAMS_URL }} | |
method: POST | |
contentType: application/json | |
data: '{"branchName": "${{ github.ref }}","actor": "${{ github.actor }}","sha": "${{ github.sha }}","eventName": "${{ github.event_name }}"}' | |
preventFailureOnNoResponse: true |