diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 029604d6..f6b427da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/.github/workflows/post-deploy.yml b/.github/workflows/post-deploy.yml index b0c02bb3..484839b8 100644 --- a/.github/workflows/post-deploy.yml +++ b/.github/workflows/post-deploy.yml @@ -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 }}/ \ diff --git a/gulpfile.js b/gulpfile.js index d121a766..9ba4e30b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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(