1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 16:28:28 -04:00

skip imagemin gulp task during CI to save a couple of minutes

This commit is contained in:
Jake Jarvis 2021-10-12 19:31:59 -04:00
parent 73637105c5
commit b58b38cd1a
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
3 changed files with 14 additions and 22 deletions

View File

@ -7,7 +7,7 @@ on:
pull_request:
jobs:
lint:
test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
@ -19,21 +19,12 @@ jobs:
node-version: 14.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build
env:
NODE_ENV: production
SKIP_OPTIMIZE_IMAGES: true
- run: yarn lint
snapshot:
runs-on: ubuntu-latest
if: "github.actor == 'jakejarvis' && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v2
with:
node-version: 14.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: NODE_ENV=production yarn build
- run: npx -p @percy/cli percy snapshot ./public
if: github.actor == 'jakejarvis'
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

View File

@ -6,18 +6,13 @@ jobs:
release:
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
env:
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LHCI_SERVER_BASE_URL: https://lhci.jrvs.io
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 10
- uses: actions/setup-node@v2
with:
node-version: 14.x
- run: yarn install --frozen-lockfile
- uses: getsentry/action-release@v1
if: github.event.deployment_status.environment == 'production'
env:
@ -33,7 +28,7 @@ jobs:
- run: |
chrome --version
lhci --version
curl $LHCI_SERVER_BASE_URL/version
curl https://lhci.jrvs.io/version || true
echo "ref: ${{ github.event.deployment.ref }}"
echo "env: ${{ github.event.deployment_status.environment }}"
echo "url: ${{ github.event.deployment_status.target_url }}"
@ -48,6 +43,9 @@ jobs:
echo "LHCI_EXTRA_FLAGS=--assert.assertions.is-crawlable=off --assert.assertions.canonical=off" >> $GITHUB_ENV
echo "LHCI_BUILD_CONTEXT__CURRENT_BRANCH=${{ github.event.deployment.ref }}" >> $GITHUB_ENV
- continue-on-error: true
env:
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
run: |
lhci autorun ${{ env.LHCI_EXTRA_FLAGS }} \
--collect.url=${{ env.BASE_DEPLOY_URL }}/ \

View File

@ -57,6 +57,9 @@ function optimizeHtml() {
}
function optimizeImages() {
// allow skipping this step via an env variable to save time during CI, etc.
if (process.env.SKIP_OPTIMIZE_IMAGES === "true") return Promise.resolve("skipped");
return gulp
.src(["public/**/*.{gif,jpg,jpeg,png,svg}", "!public/assets/emoji/**/*"], { base: "./" })
.pipe(