Skip to content

Commit

Permalink
fix(build): Cache binaries to reduce build time
Browse files Browse the repository at this point in the history
  • Loading branch information
rishikanthc authored Oct 16, 2024
1 parent 0b90a78 commit b432e50
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/github-actions-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Cache Node.js dependencies
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache compiled binaries
uses: actions/cache@v3
with:
path: |
/usr/local/bin/
/usr/local/share/man/man1/
/usr/local/share/man/man5/
key: ${{ runner.os }}-build-${{ hashFiles('Dockerfile') }}

- name: Build and push to GHCR
uses: docker/build-push-action@v6
Expand All @@ -27,6 +45,8 @@ jobs:
push: true
tags: |
ghcr.io/rishikanthc/scriberr:nightly
cache-from: type=registry,ref=ghcr.io/rishikanthc/scriberr:nightly
cache-to: type=registry,ref=ghcr.io/rishikanthc/scriberr:nightly,mode=max

- name: Push image to GHCR
run: |
Expand Down

0 comments on commit b432e50

Please sign in to comment.