npm-dressca-frontend: bump cypress from 13.5.1 to 13.6.0 in /samples/web-csr/dressca-frontend #531
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: # yamllint disable-line rule:truthy | |
push: | |
branches: [main] | |
tags: | |
- 'v[0-9]+.[0-9]+.[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' | |
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 | |
steps: | |
- name: ブランチのチェックアウト | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Linter の処理開始 | |
run: | | |
echo '# Linter Result :newspaper:' >> $GITHUB_STEP_SUMMARY | |
- name: GitHub Super Linter の実行 | |
id: execute_super_linter | |
continue-on-error: true | |
uses: github/super-linter/slim@v4 | |
env: | |
VALIDATE_ALL_CODEBASE: true | |
DEFAULT_BRANCH: main | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FILTER_REGEX_INCLUDE: "documents/.*" | |
LINTER_RULES_PATH: / | |
MARKDOWN_CONFIG_FILE: '.markdownlint.yaml' | |
VALIDATE_MARKDOWN: true | |
VALIDATE_YAML: true | |
YAML_CONFIG_FILE: '.yaml-lint.yml' | |
- name: GitHub Super Linter の結果表示 | |
run: | | |
echo '## GitHub Super linter' >> $GITHUB_STEP_SUMMARY | |
echo '::group::super-linter.log' | |
cat super-linter.log | |
echo '::endgroup::' | |
LINT_MSG=$(sed '/^$/d' super-linter.log | sed -n -e '/^------/,/^------/p' | sed -n -e '/^[^-]/p' | awk '!a[$0]++{print}') | |
if [ -n "$LINT_MSG" ]; then | |
echo ':warning: エラーまたは警告が見つかりました。' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
echo "$LINT_MSG" >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
else | |
echo ':heavy_check_mark: 成功しました。' >> $GITHUB_STEP_SUMMARY | |
fi | |
- name: GitHub Super Linter の処理結果確認 | |
if: ${{ steps.execute_super_linter.outcome == 'failure' }} | |
run: | | |
exit 1 | |
- name: npm パッケージのインストール | |
run: | | |
npm install | |
- name: textlint の実行 | |
id: execute_textlint | |
continue-on-error: true | |
run: | | |
echo '## textlint Result' >> $GITHUB_STEP_SUMMARY | |
npm run textlint-all > textlint-result.txt | |
echo ':heavy_check_mark: textlint に成功しました。' >> $GITHUB_STEP_SUMMARY | |
- name: textlint 失敗時の結果表示 | |
if: ${{ steps.execute_textlint.outcome == 'failure' }} | |
run: | | |
echo '::group::textlint-result.txt' | |
cat textlint-result.txt | |
echo '::endgroup::' | |
echo ':x: textlint に失敗しました。 ' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
cat textlint-result.txt | sed -n -e '/problems\?/p' >> $GITHUB_STEP_SUMMARY | |
echo '```' >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
- name: Python のセットアップ | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: mkdocs のインストール | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install mkdocs | |
python -m pip install mkdocs-material | |
python -m pip install pymdown-extensions | |
python -m pip install mkdocs-minify-plugin | |
- name: dressca.zip の作成 | |
run: | | |
cd samples/web-csr | |
zip -r ../../documents/contents/samples/downloads/dressca.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@v3 | |
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@v3 | |
with: | |
name: documents | |
- name: Githubのリリース | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ env.DOCUMENT_ARTIFACTS_FILENAME }} | |
generate_release_notes: true | |
release-documents: | |
name: ドキュメントのリリース | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: ビルドアーティファクトのダウンロード | |
uses: actions/download-artifact@v3 | |
with: | |
name: documents | |
- name: Azure に OIDC Login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: ステージング環境へのデプロイ | |
uses: azure/webapps-deploy@v2 | |
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: 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 |