python: bump mkdocs-material from 9.5.17 to 9.5.18 #1113
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: | |
branches: [main] | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+-Beta[0-9]+' | |
pull_request: | |
branches: [main] | |
paths: | |
- 'documents/**' | |
- 'iis-files/**' | |
- 'samples/**' | |
- '.github/workflows/build-and-release-documents.yml' | |
- '.markdownlint.yaml' | |
- '.textlintrc' | |
- '.yaml-lint.yml' | |
- 'package-lock.json' | |
- 'package.json' | |
- 'requirements.txt' | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
env: | |
APP_ALESINFINY_MAIA_WEBAPP_NAME: app-alesinfiny-maia-docs-prod | |
DOCUMENT_ARTIFACTS_FILENAME: docs.zip | |
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: 1 | |
- name: Node.js のセットアップ | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: npm パッケージのインストール | |
run: npm ci | |
- name: Python のセットアップ | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: pip パッケージのインストール | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
- name: Linter の処理開始 | |
run: echo '# Linter Result :newspaper:' >> $GITHUB_STEP_SUMMARY | |
- name: Markdownlint の実行 | |
id: run-markdownlint | |
continue-on-error: true | |
run: | | |
echo '## Markdownlint Result' >> $GITHUB_STEP_SUMMARY | |
npx markdownlint --config .markdownlint.yaml --ignore **/node_modules/** --output markdownlint-result.txt . | |
echo ':heavy_check_mark: Markdownlint に成功しました。' >> $GITHUB_STEP_SUMMARY | |
- name: Markdownlint 失敗時の結果表示 | |
if: ${{ steps.run-markdownlint.outcome == 'failure' }} | |
run: | | |
echo ':x: Markdownlint に失敗しました。 ' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat markdownlint-result.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
echo 'LINT_STATUS=Error' >> $GITHUB_ENV | |
- name: yamllint の実行 | |
id: run-yamllint | |
continue-on-error: true | |
run: | | |
echo '## yamllint Result' >> $GITHUB_STEP_SUMMARY | |
yamllint --config-file .yaml-lint.yml --format standard . > yamllint-result.txt | |
echo ':heavy_check_mark: yamllint に成功しました。' >> $GITHUB_STEP_SUMMARY | |
- name: yamllint 失敗時の結果表示 | |
if: ${{ steps.run-yamllint.outcome == 'failure' }} | |
run: | | |
echo ':x: yamllint に失敗しました。 ' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat yamllint-result.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
echo 'LINT_STATUS=Error' >> $GITHUB_ENV | |
- name: textlint の実行 | |
run: | | |
echo '## textlint Result' >> $GITHUB_STEP_SUMMARY | |
npx textlint documents samples --output-file textlint-result.txt --format compact | |
if [ -f textlint-result.txt ]; then | |
echo ':x: textlint に失敗しました。 ' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat textlint-result.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
echo 'LINT_STATUS=Error' >> $GITHUB_ENV | |
else | |
echo ':heavy_check_mark: textlint に成功しました。' >> $GITHUB_STEP_SUMMARY | |
fi | |
- name: Lint 結果の確認 | |
if: ${{ env.LINT_STATUS == 'Error' }} | |
run: exit 1 | |
- name: dressca.zip の作成 | |
run: | | |
cd samples/web-csr | |
zip -r ../../documents/contents/samples/downloads/dressca.zip * | |
- name: azure-ad-b2c.zipの作成 | |
run: | | |
cd samples/azure-ad-b2c-sample | |
zip -r ../../documents/contents/samples/downloads/azure-ad-b2c.zip * | |
- name: ドキュメントのビルド | |
id: build_documents | |
continue-on-error: true | |
run: | | |
if [ ${{ startsWith(github.ref, 'refs/tags/v') }} ]; | |
then | |
export VERSION="${{ github.ref_name }}" | |
else | |
export VERSION="Test Version" | |
fi | |
cd documents | |
echo '# Mkdocs Build Result :factory:' >> $GITHUB_STEP_SUMMARY | |
mkdocs build --verbose --clean --strict > mkdocs_build_log.txt | |
- name: ドキュメントビルドの結果表示(成功) | |
if: ${{ steps.build_documents.outcome == 'success' }} | |
run: | | |
echo ':heavy_check_mark: mkdocs のビルドに成功しました。' >> $GITHUB_STEP_SUMMARY | |
cd documents | |
if [ -s mkdocs_build_log.txt ]; then | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat mkdocs_build_log.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
fi | |
- name: ドキュメントビルドの結果表示(失敗) | |
if: ${{ steps.build_documents.outcome == 'failure' }} | |
run: | | |
echo ':x: mkdocs のビルドに失敗しました。' >> $GITHUB_STEP_SUMMARY | |
cd documents | |
if [ -s mkdocs_build_log.txt ]; then | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat mkdocs_build_log.txt >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
fi | |
exit 1 | |
- name: IIS 用のファイル配置とパッケージング | |
run: | | |
cp -T -v -f -r iis-files documents/build-artifacts/ | |
cd documents/build-artifacts | |
zip -r ../${{ env.DOCUMENT_ARTIFACTS_FILENAME }} * | |
- name: ビルドアーティファクトのアップロード | |
uses: actions/upload-artifact@v4 | |
with: | |
name: documents | |
path: documents/${{ env.DOCUMENT_ARTIFACTS_FILENAME }} | |
retention-days: 7 | |
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@v2 | |
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@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: ステージング環境へのデプロイ | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: ${{ env.APP_ALESINFINY_MAIA_WEBAPP_NAME }} | |
slot-name: staging | |
package: '${{ env.DOCUMENT_ARTIFACTS_FILENAME }}' | |
- name: Teams への通知 | |
uses: fjogeleit/http-request-action@v1 | |
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: [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@v1 | |
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 |