From ed26abac8f1f19a9bee04036c0bb2cd4277b498f Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 09:53:16 -0500 Subject: [PATCH 1/9] test out workflow --- .github/workflow.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflow.yml diff --git a/.github/workflow.yml b/.github/workflow.yml new file mode 100644 index 000000000..90984f72c --- /dev/null +++ b/.github/workflow.yml @@ -0,0 +1,26 @@ +name: Upload Rollbar.js release to S3 + +# on: +# release: +# types: [published] + +on: + push: + branches: + - austen/ch62549/add-upload-to-s3-workflow + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: jakejarvis/s3-sync-action@master + with: + args: --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'us-east-1' + SOURCE_DIR: 'dist' + DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release From c528385a21b18e70974c626923ddfe2ac8f10d58 Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 09:55:35 -0500 Subject: [PATCH 2/9] add missing subdir in github workflows --- .github/{ => workflows}/workflow.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/workflow.yml (100%) diff --git a/.github/workflow.yml b/.github/workflows/workflow.yml similarity index 100% rename from .github/workflow.yml rename to .github/workflows/workflow.yml From fdb728e60491a9264268fdaa292974b06364e37d Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 09:57:25 -0500 Subject: [PATCH 3/9] test out workflow with tag --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 90984f72c..496355197 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -23,4 +23,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: v1.0.0 # GITHUB_REF is the tag of the release From 44fc986b712667ea57ff9720e4bd2ef0dbc4c2b9 Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 09:59:34 -0500 Subject: [PATCH 4/9] only run workflow when a release is published and use the tag as the path in s3 with the release --- .github/workflows/workflow.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 496355197..750c7687e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,13 +1,8 @@ name: Upload Rollbar.js release to S3 -# on: -# release: -# types: [published] - on: - push: - branches: - - austen/ch62549/add-upload-to-s3-workflow + release: + types: [published] jobs: deploy: @@ -23,4 +18,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: v1.0.0 # GITHUB_REF is the tag of the release + DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release From 77fb0389e06fcc47e8bacfa0c0a51574f12696c7 Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 10:03:35 -0500 Subject: [PATCH 5/9] ping action version --- .github/workflows/workflow.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 750c7687e..05d931108 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,15 +1,20 @@ name: Upload Rollbar.js release to S3 +# on: +# release: +# types: [published] + on: - release: - types: [published] + push: + branches: + - austen/ch62549/add-upload-to-s3-workflow jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: jakejarvis/s3-sync-action@master + - uses: jakejarvis/s3-sync-action@v0.5.1 with: args: --follow-symlinks --delete env: @@ -18,4 +23,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: v1.0.0 #$GITHUB_REF # GITHUB_REF is the tag of the release From b295e5e0daa9f088f48b98cd41ad1176adba59ff Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 10:05:46 -0500 Subject: [PATCH 6/9] use pinned version and revert back to only on publish --- .github/workflows/workflow.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 05d931108..776733e7b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,13 +1,8 @@ name: Upload Rollbar.js release to S3 -# on: -# release: -# types: [published] - on: - push: - branches: - - austen/ch62549/add-upload-to-s3-workflow + release: + types: [published] jobs: deploy: @@ -23,4 +18,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: v1.0.0 #$GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release From 25af8e2f94f3bc1000589208062b4ec5274c4fd5 Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 13:58:49 -0500 Subject: [PATCH 7/9] use correct rollbarjs prefix --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 776733e7b..9934fc8c8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,4 +18,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: $GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: rollbarjs/$GITHUB_REF # GITHUB_REF is the tag of the release From b6785db6c2c0d7583b98a788f5204f1263fa041e Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 14:14:55 -0500 Subject: [PATCH 8/9] test with prefix again just to make sure --- .github/workflows/workflow.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9934fc8c8..578cbfcf7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,8 +1,13 @@ name: Upload Rollbar.js release to S3 +# on: +# release: +# types: [published] + on: - release: - types: [published] + push: + branches: + - austen/ch62549/add-upload-to-s3-workflow jobs: deploy: @@ -18,4 +23,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: rollbarjs/$GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: rollbarjs/v1.0.0 #$GITHUB_REF # GITHUB_REF is the tag of the release From 4ecae1d01ff5faf9ddf7933f9e7dd3dc9d256dff Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Thu, 5 Mar 2020 14:17:31 -0500 Subject: [PATCH 9/9] verified prefix works and change workflow job name to be more descriptive --- .github/workflows/workflow.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 578cbfcf7..0f4b49fe9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,16 +1,11 @@ name: Upload Rollbar.js release to S3 -# on: -# release: -# types: [published] - on: - push: - branches: - - austen/ch62549/add-upload-to-s3-workflow + release: + types: [published] jobs: - deploy: + upload-distros-to-s3: runs-on: ubuntu-latest steps: - uses: actions/checkout@master @@ -23,4 +18,4 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-east-1' SOURCE_DIR: 'dist' - DEST_DIR: rollbarjs/v1.0.0 #$GITHUB_REF # GITHUB_REF is the tag of the release + DEST_DIR: rollbarjs/$GITHUB_REF # GITHUB_REF is the tag of the release