Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
refs #137 Add Workflow steps S3 Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
euledge committed Apr 14, 2020
1 parent 804a403 commit 0e79e5e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 30 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@ name: production deploy
on:
push:
branches:
- master
- prod-hamamatsu

jobs:
deploy:
runs-on: ubuntu-18.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: master
ref: prod-hamamatsu

- name: Setup Node
uses: actions/setup-node@v1
Expand All @@ -32,28 +30,17 @@ jobs:
- run: yarn run test
- run: yarn run generate:deploy --fail-on-page-error

- name: Temporarily disable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@master
if: always()
- name: deploy to s3
uses: jakejarvis/s3-sync-action@master
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
branch: production
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ''
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_DEPLOY_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_DEPLOY_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-1' # optional: defaults to us-east-1
SOURCE_DIR: './dist'

- 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: tokyo-metropolitan-gov
repo: covid19
branch: production
- name: Create GitHub release
uses: rymndhng/release-on-push-action@master
with:
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: development deploy
on:
push:
branches:
- development
- dev-hamamatsu

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
ref: dev-hamamatsu

- name: Setup Node
uses: actions/setup-node@v1
Expand All @@ -29,9 +31,13 @@ jobs:
- run: yarn run generate:dev --fail-on-page-error
- run: "echo \"User-agent: *\nDisallow: /\" > ./dist/robots.txt"

- name: deploy
uses: peaceiris/actions-gh-pages@v3
- name: deploy to s3
uses: jakejarvis/s3-sync-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: dev-pages
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ''
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_DEPLOY_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_DEPLOY_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-1' # optional: defaults to us-east-1
SOURCE_DIR: './dist'

0 comments on commit 0e79e5e

Please sign in to comment.