Skip to content

Commit

Permalink
[WIP] upload images to Imgbb
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalitov committed Dec 3, 2024
1 parent ae9d4bc commit 81dac18
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
58 changes: 43 additions & 15 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defaults:

jobs:
# Check on PR
web:
screenshots:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.108.0
Expand Down Expand Up @@ -48,23 +48,51 @@ jobs:
--minify
- name: Make screenshots
run: npm run screenshot
- name: Upload files
uses: gavv/pull-request-artifacts@v2
- name: Upload files as artifacts
id: upload-files-artifacts
uses: actions/upload-artifact@master
with:
commit: ${{ github.event.pull_request.head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifacts-branch: artifacts
artifacts: |
name: Screenshots
path: |
src/public/index.html
360x800.jpg
390x844.jpg
414x896.jpg
640x360.jpg
./*.jpg
- name: Upload files to Imgbb
id: upload-files-imgbb
uses: McCzarny/upload-image@v1.0.0
with:
path: |
320x568.jpg
568x320.jpg
360x780.jpg
780x360.jpg
960x540.jpg
1200x800.jpg
375x812.jpg
812x375.jpg
390x844.jpg
844x390.jpg
430x932.jpg
932x430.jpg
768x1024.jpg
1024x768.jpg
820x1180.jpg
1180x820.jpg
1280x720.jpg
1366x768.jpg
1600x900.jpg
1920x1080.jpg
uploadMethod: imgbb
apiKey: '${{ secrets.IMGBB_API_KEY }}'
- name: Publish the images
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
# Screenshots
## Smartphones
### iPhone 5
| Portrait Mode | Landscape Mode |
|----|----|
| ![iPhone 5 portrait mode screenshot]({{steps.upload-files-imgbb.outputs.url[0]}}) | ![iPhone 5 portrait mode screenshot]({{steps.upload-files-imgbb.outputs.url[1]}}) |
### Tablets
### Desktop
[Full ZIP](${{ steps.upload-files-artifacts.outputs.artifact-url }})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"markdown:fix": "remark . --frail --output",
"jest": "jest",
"coverage": "jest --coverage",
"screenshot": "pageres ./src/public/index.html 360x800 390x844 414x896 640x360 780x360 960x540 1200x800 1024x768 1280x720 1366x768 1600x900 1920x1080 --overwrite --format=jpg --crop --filename=\"<%= size %>\"",
"screenshot": "pageres ./src/public/index.html 320x568 568x320 360x780 780x360 375x812 812x375 390x844 844x390 430x932 932x430 768x1024 1024x768 820x1180 1180x820 960x540 1024x1366 1200x800 1280x720 1366x768 1600x900 1920x1080 --overwrite --format=jpg --crop --filename=\"<%= size %>\"",
"stylelint": "stylelint -f verbose \"src/**/*.css\"",
"stylelint:fix": "stylelint \"src/**/*.css\" --fix",
"test": "npm run lint && npm run stylelint && npm run markdown && npm run markdownlint && npm run package && npm run json && npm run jest"
Expand Down

0 comments on commit 81dac18

Please sign in to comment.