From 0e79e5e9bcaffb47d7323ba1022417aef8625cf2 Mon Sep 17 00:00:00 2001 From: euledge Date: Tue, 14 Apr 2020 18:57:27 +0900 Subject: [PATCH 1/4] refs #137 Add Workflow steps S3 Deploy --- .github/workflows/deploy.yml | 35 +++++++++++------------------------ .github/workflows/develop.yml | 18 ++++++++++++------ 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1f6df13a9e79c..5d8c80bb26952 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -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: diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 6c98803af3cd7..f04f1a20aecf3 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -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 @@ -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' \ No newline at end of file From aab6bbf6e9dc6e8ce6709d7b5abdd6c073483ddb Mon Sep 17 00:00:00 2001 From: Hitoshi Kuroyanagi Date: Wed, 22 Apr 2020 02:26:39 +0900 Subject: [PATCH 2/4] =?UTF-8?q?develop=E7=94=A8=E3=81=AEBUCKET=E3=82=92?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index f04f1a20aecf3..df6216d1b000b 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -36,7 +36,7 @@ jobs: with: args: --acl public-read --follow-symlinks --delete env: - AWS_S3_BUCKET: '' + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_DEVELOP }} 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 From 7c35622deba313ec0ea15afc26c740b54e8dc0dc Mon Sep 17 00:00:00 2001 From: Hitoshi Kuroyanagi Date: Wed, 22 Apr 2020 02:28:49 +0900 Subject: [PATCH 3/4] Revert "refs #137 Add Workflow steps S3 Deploy" This reverts commit 0e79e5e9bcaffb47d7323ba1022417aef8625cf2. --- .github/workflows/deploy.yml | 35 ++++++++++++++++++++++++----------- .github/workflows/develop.yml | 10 ++++------ 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5d8c80bb26952..1f6df13a9e79c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,15 +3,17 @@ name: production deploy on: push: branches: - - prod-hamamatsu + - master jobs: deploy: runs-on: ubuntu-18.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 with: - ref: prod-hamamatsu + ref: master - name: Setup Node uses: actions/setup-node@v1 @@ -30,17 +32,28 @@ jobs: - run: yarn run test - run: yarn run generate:deploy --fail-on-page-error - - name: deploy to s3 - uses: jakejarvis/s3-sync-action@master + - name: Temporarily disable "include administrators" branch protection + uses: benjefferies/branch-protection-bot@master + if: always() with: - 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' + 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: tokyo-metropolitan-gov + repo: covid19 + branch: production - name: Create GitHub release uses: rymndhng/release-on-push-action@master with: diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index df6216d1b000b..635cb019b7d81 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -3,15 +3,13 @@ name: development deploy on: push: branches: - - dev-hamamatsu + - development jobs: deploy: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - with: - ref: dev-hamamatsu - name: Setup Node uses: actions/setup-node@v1 @@ -31,8 +29,8 @@ jobs: - run: yarn run generate:dev --fail-on-page-error - run: "echo \"User-agent: *\nDisallow: /\" > ./dist/robots.txt" - - name: deploy to s3 - uses: jakejarvis/s3-sync-action@master + - name: deploy + uses: peaceiris/actions-gh-pages@v3 with: args: --acl public-read --follow-symlinks --delete env: @@ -40,4 +38,4 @@ jobs: 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' \ No newline at end of file + SOURCE_DIR: './dist' From 562f57b05691bff5cfce0413715028cf8a7f068d Mon Sep 17 00:00:00 2001 From: Hitoshi Kuroyanagi Date: Wed, 22 Apr 2020 02:32:26 +0900 Subject: [PATCH 4/4] =?UTF-8?q?revert=E3=81=A7=E5=85=83=E3=81=AB=E6=88=BB?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=9F=E9=83=A8?= =?UTF-8?q?=E5=88=86=E3=82=92=E5=86=8D=E5=BA=A6=E6=9B=B8=E3=81=8D=E7=9B=B4?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 635cb019b7d81..df6216d1b000b 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -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 @@ -29,8 +31,8 @@ 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: args: --acl public-read --follow-symlinks --delete env: @@ -38,4 +40,4 @@ jobs: 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' + SOURCE_DIR: './dist' \ No newline at end of file