add if #2
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
name: Master-Deploy | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "sources/**" | ||
workflow_dispatch: | ||
branches: | ||
- "main" | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
TZ: "Asia/Tokyo" | ||
steps: | ||
- name: Setup repository | ||
uses: actions/checkout@v3 | ||
- name: Initialize | ||
uses: ./.github/actions/initialize | ||
- name: Test | ||
run: | | ||
npm run test | ||
docs: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
env: | ||
src_dir: sources/src | ||
dst_dir: docs/typedoc | ||
steps: | ||
- name: Setup repository | ||
uses: actions/checkout@v3 | ||
- name: Initialize | ||
uses: ./.github/actions/initialize | ||
- name: Install modules | ||
run: npm install -g typedoc typedoc-plugin-markdown @types/google-apps-script | ||
- name: Generate Docs | ||
run: typedoc --entryPoints ${src_dir} --entryPointStrategy expand --out ${dst_dir} --cleanOutputDir --plugin typedoc-plugin-markdown --disableSources --readme none | ||
- name: Push | ||
run: | | ||
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
if (git diff --shortstat --relative=${dst_dir} | grep '[0-9]'); then \ | ||
git add ${dst_dir}; \ | ||
git commit -m "GitHub Actions から差分を Push"; \ | ||
git push origin HEAD:${GITHUB_REF}; \ | ||
fi | ||
deploy: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
if: ${{ secrets.ACCESS_TOKEN && secrets.ID_TOKEN && secrets.REFRESH_TOKEN && secrets.CLIENT_ID && secrets.CLIENT_SECRET && secrets.MASTER_SCRIPT_ID && secrets.MASTER_DEPLOYMENT_ID }} | ||
Check failure on line 62 in .github/workflows/deploy_master.yaml GitHub Actions / Master-DeployInvalid workflow file
|
||
env: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
ID_TOKEN: ${{ secrets.ID_TOKEN }} | ||
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | ||
CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | ||
SCRIPT_ID: ${{ secrets.MASTER_SCRIPT_ID }} | ||
DEPLOYMENT_ID: ${{ secrets.MASTER_DEPLOYMENT_ID }} | ||
ENV_NAME: "Production" | ||
steps: | ||
- name: Setup repository | ||
uses: actions/checkout@v3 | ||
- name: Initialize | ||
uses: ./.github/actions/initialize | ||
- name: DEPLOY | ||
run: | | ||
npm run deploy |