Skip to content

Commit

Permalink
Merge pull request #344 from CodeForNagasaki/development
Browse files Browse the repository at this point in the history
Master <- Develop
  • Loading branch information
sugasaki authored Aug 17, 2021
2 parents 5ccc9ca + ab45cfe commit 09c58da
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/dayly-deploy.yml
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 }}

0 comments on commit 09c58da

Please sign in to comment.