Skip to content

Commit

Permalink
Update the upload action
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaskorhonen committed Sep 27, 2023
1 parent 8c7eb62 commit c901cfb
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,33 @@ jobs:
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/visual-snapshots.zip', Buffer.from(download.data));
- name: Create directory
run: mkdir -p visual-snapshots
- name: Unzip artifact
run: unzip visual-snapshots.zip
run: unzip visual-snapshots.zip -d ./visual-snapshots
- name: Display structure of downloaded files
run: ls -R
# - name: Upload to B2
# uses: shallwefootball/s3-upload-action@master
# id: B2
# with:
# aws_key_id: ${{ secrets.AWS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
# aws_bucket: ${{ vars.AWS_BUCKET }}
# endpoint: ${{ vars.AWS_ENDPOINT }}
# source_dir: "visual-snapshots"
# destination_dir: "30-days/${{ github.repository }}/${{ github.run_id }}"
# - name: Generate snapshots comment
# run: ./bin/snapshots-comment '${{steps.B2.outputs.object_locations}}'
# - uses: jwalton/gh-find-current-pr@v1
# id: finder
# - uses: marocchino/sticky-pull-request-comment@v2
# with:
# number: ${{ steps.finder.outputs.pr }}
# header: "Visual Snapshots"
# path: "./visual-snapshots.tmp"
# - name: Job summary (visuals)
# run: cat visual-snapshots.tmp > $GITHUB_STEP_SUMMARY
run: ls -R visual-snapshots/
- name: Set variables
run: |
PR_NUMBER=$(cat ./visual-snapshots/pr.txt)
echo "PR_NUMBER=$VER" >> $GITHUB_ENV
- name: Upload to B2
uses: shallwefootball/s3-upload-action@master
id: B2
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
endpoint: ${{ vars.AWS_ENDPOINT }}
source_dir: "visual-snapshots"
destination_dir: "30-days/${{ github.repository }}/${{ github.run_id }}"
- name: Generate snapshots comment
run: ./bin/snapshots-comment '${{steps.B2.outputs.object_locations}}'
- uses: marocchino/sticky-pull-request-comment@v2
if: ${{ env.PR_NUMBER != '' }}
with:
number: ${{ env.PR_NUMBER }}
header: "Visual Snapshots"
path: "./visual-snapshots.tmp"
- name: Job summary (visuals)
run: cat visual-snapshots.tmp > $GITHUB_STEP_SUMMARY

0 comments on commit c901cfb

Please sign in to comment.