forked from Tokyo-Metro-Gov/covid19
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from CodeForNagasaki/development
Master <- Develop
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: production deploy | ||
|
||
on: | ||
schedule: | ||
- cron: '50 5,13 * * *' # 毎日UTCの5:40と13:40にトリガーされます。(日本時間の14:40と22:40) | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-18.04 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.16.0' | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/yarn | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn run test | ||
- name: generate | ||
run: | | ||
echo "GOOGLE_ANALYTICS_ID=${GOOGLE_ANALYTICS_ID}" >> .env.production | ||
cat .env.production | ||
yarn run generate:deploy --fail-on-page-error | ||
env: | ||
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }} | ||
|
||
- name: Temporarily disable "include administrators" branch protection | ||
uses: benjefferies/branch-protection-bot@master | ||
if: always() | ||
with: | ||
access-token: ${{ secrets.ACCESS_TOKEN }} | ||
branch: production | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
publish_branch: production | ||
|
||
- name: Enable "include administrators" branch protection | ||
uses: benjefferies/branch-protection-bot@master | ||
if: always() # Force to always run this step to ensure "include administrators" is always turned back on | ||
with: | ||
access-token: ${{ secrets.ACCESS_TOKEN }} | ||
owner: CodeForNagasaki | ||
repo: covid19 | ||
branch: production | ||
- name: Create GitHub release | ||
uses: rymndhng/release-on-push-action@master | ||
with: | ||
bump_version_scheme: patch | ||
|
||
- name: run delete_fbcache.sh | ||
run: | | ||
echo "FB_ACCESS_TOKEN=${FACEBOOK_ACCESS_TOKEN}" > .env | ||
cd ui-test | ||
./delete_fbcache.sh | ||
env: | ||
FACEBOOK_ACCESS_TOKEN: ${{ secrets.FACEBOOK_ACCESS_TOKEN }} |