Skip to content

Commit

Permalink
ci: fix ci cache error
Browse files Browse the repository at this point in the history
  • Loading branch information
yld-weng committed Apr 13, 2022
1 parent 0c241e0 commit ae200ad
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

jobs:
Check-Duplicate:
runs-on: ubuntu-latest
runs-on: windows-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
Expand All @@ -36,7 +36,7 @@ jobs:
CI-Build:
needs: Check-Duplicate
if: ${{ needs.Check-Duplicate.outputs.should_skip != 'true' }}
runs-on: windows-2019
runs-on: windows-latest
defaults:
run:
shell: bash
Expand All @@ -46,17 +46,15 @@ jobs:

- uses: actions/checkout@v3

- name: NPM Cache
id: npm-cache
uses: actions/cache@v3
- uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-cache-
node-version: '16'
cache: 'npm'

# Retrieve gatsby cache
# Creates new cache when OS/run_id changes
- name: Gatsby Cache
if: "!contains(github.event.head_commit.message, 'skip cache')"
id: gatsby-ci-cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -86,12 +84,14 @@ jobs:
GATSBY_ENV: ${{ secrets.GATSBY_ENV }}

- name: Serve and E2E test
run: npm run serve & npm run test:e2e
run: npm run serve; npm run test:e2e; tskill node

- run: echo "ps"

Test:
needs: Check-Duplicate
if: ${{ needs.Check-Duplicate.outputs.should_skip != 'true' }}
runs-on: windows-2019
runs-on: windows-latest
defaults:
run:
shell: bash
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
Deploy-QA:
runs-on: windows-2019
runs-on: windows-latest
defaults:
run:
shell: bash
Expand All @@ -28,17 +28,15 @@ jobs:

- uses: actions/checkout@v3

- name: NPM Cache
id: npm-cache
uses: actions/cache@v2
- uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-cache-
node-version: '16'
cache: 'npm'

- name: Gatsby QA Cache
if: "!contains(github.event.head_commit.message, 'skip cache')"
id: gatsby-qa-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
public
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
runs-on: windows-latest
defaults:
run:
shell: bash
Expand All @@ -33,15 +33,13 @@ jobs:
ref: master
persist-credentials: false

- name: NPM Cache
id: npm-cache
uses: actions/cache@v2
- uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-cache-
node-version: '16'
cache: 'npm'

- name: Gatsby Cache
if: "!contains(github.event.head_commit.message, 'skip cache')"
id: gatsby-deploy-cache
uses: actions/cache@v2
with:
Expand Down

0 comments on commit ae200ad

Please sign in to comment.