Skip to content

feat: use cache for docker build #14

feat: use cache for docker build

feat: use cache for docker build #14

Workflow file for this run

name: Push app to GHCR
on:
workflow_dispatch:
push:
branches: [ "main" ]
jobs:
runTests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/evanp/onepage.pub:latest
cache-from: type=registry,ref=ghcr.io/evanp/onepage.pub:latest
cache-to: type=inline