Skip to content

Commit

Permalink
test image push
Browse files Browse the repository at this point in the history
  • Loading branch information
martvanrijthoven committed Dec 18, 2020
1 parent bbea01a commit ff4c36f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Optimize Images
on:
push:
branches: master
branches: [master]
paths:
- "content/images/**"

jobs:
cancel-running-jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}

images:
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') }}
runs-on: ubuntu-latest
Expand All @@ -23,11 +31,45 @@ jobs:
- name: Setup npm
run: npm install --prefix imgoptim --no-save
- name: Optimize
run: bash ./optimize_images.sh

- name: Optimize Images
run: node imgoptim/optimize.js

- uses: stefanzweifel/git-auto-commit-action@v4
with:
# Optional but recommended
# Defaults to "Apply automatic changes"
commit_message: Update optimized images

# # Optional options appended to `git-commit`
# # See https://git-scm.com/docs/git-commit for a list of available options
# commit_options: "--no-verify --signoff"

# Optional glob pattern of files which should be added to the commit
# Defaults to all (.)
# See the `pathspec`-documentation for git
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
file_pattern: image-cache.json assets/images/*

# Optional commit user and author settings
# commit_user_name: My GitHub Actions Bot # defaults to "GitHub Actions"
# commit_user_email: my-github-actions-bot@example.org # defaults to "actions@github.com"
# commit_author: Author <actions@github.com> # defaults to author of the commit that triggered the run
# # Optional tag message
# # Action will create and push a new tag to the remote repository and the defined branch
# tagging_message: "v1.0.0"
# Optional options appended to `git-push`
# See git-push documentation for details: https://git-scm.com/docs/git-push#_options
# push_options: "--force"
# Optional: Disable dirty check and always try to create a commit and push
# skip_dirty_check: true
# Optional: Skip internal call to `git fetch`
# skip_fetch: true

- name: Deploy images to Netlify
run: |
cp -r --no-clobber ./content/images/. assets/images
yarn global add netlify-cli
"$(yarn global bin)/netlify" deploy --dir=assets --prod
shell: bash
Expand Down
Binary file added content/images/testimage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ff4c36f

Please sign in to comment.