Skip to content

Commit

Permalink
Transform upload-to-gcs job to into a matrix one
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Dec 29, 2020
1 parent 9585aca commit 3a2323b
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,30 +530,25 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-zip
steps:
- name: Download dev build
uses: actions/download-artifact@v2
with:
name: amp-${{ needs.build-zip.outputs.branch-name }}-${{ needs.build-zip.outputs.git-sha-8 }}-dev
path: builds/dev
strategy:
matrix:
build: [ 'dev', 'prod', 'composer' ]

- name: Download prod build
steps:
- name: Download ${{ matrix.build }} build
uses: actions/download-artifact@v2
with:
name: amp-${{ needs.build-zip.outputs.branch-name }}-${{ needs.build-zip.outputs.git-sha-8 }}-prod
path: builds/prod
name: amp-${{ needs.build-zip.outputs.branch-name }}-${{ needs.build-zip.outputs.git-sha-8 }}-${{ matrix.build }}
path: builds/${{ matrix.build }}

- name: Setup Google Cloud SDK
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCS_PROJECT_ID }}
service_account_key: ${{ secrets.GCS_APPLICATION_CREDENTIALS }}

- name: Upload dev build to bucket
run: gsutil cp -r builds/dev/amp.zip gs://ampwp_github_artifacts/${{ github.ref }}/dev/amp.zip

- name: Upload prod build to bucket
run: gsutil cp -r builds/prod/amp.zip gs://ampwp_github_artifacts/${{ github.ref }}/prod/amp.zip
- name: Upload ${{ matrix.build }} build to bucket
run: gsutil cp -r builds/${{ matrix.build }}/amp.zip gs://ampwp_github_artifacts/${{ github.ref }}/${{ matrix.build }}/amp.zip

#-----------------------------------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 3a2323b

Please sign in to comment.