Skip to content

Commit

Permalink
Use cache instead of artifact in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianKrebel committed Dec 17, 2024
1 parent 3c323ee commit 7772021
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ jobs:
- name: Test
run: npm run test-cov

- name: Upload artifacts
uses: actions/upload-artifact@v4
- name: Cache build outputs and dependencies
uses: actions/cache/save@v4
with:
name: build-artifacts
path: |
declarations/
dist/
Expand All @@ -57,9 +56,11 @@ jobs:
examples/
coverage/
docs/
node_modules/
LICENSE*
*.html
*.md
key: ${{ runner.os }}-build-deps-${{ github.sha }}

release:
needs: build-and-test
Expand All @@ -69,17 +70,33 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21.7.3"
registry-url: "https://registry.npmjs.org"

- name: Restore cached build outputs and dependencies
uses: actions/cache/restore@v4
with:
path: |
declarations/
dist/
esnext/
peer/
standalone/
styles/
types/
examples/
coverage/
docs/
node_modules/
LICENSE*
*.html
*.md
key: ${{ runner.os }}-build-deps-${{ github.sha }}
fail-on-cache-miss: true

- name: Release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down

0 comments on commit 7772021

Please sign in to comment.