mirror of
https://github.com/jrasanen/writefreely-docker.git
synced 2025-05-08 15:16:03 +03:00
add layer caching, build args
This commit is contained in:
parent
2caf947ab4
commit
1275ba1e23
2 changed files with 15 additions and 23 deletions
22
.github/workflows/docker-publish.yml
vendored
22
.github/workflows/docker-publish.yml
vendored
|
@ -15,6 +15,7 @@ concurrency:
|
|||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
WRITEFREELY_VERSION: v0.15.0
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -37,13 +38,14 @@ jobs:
|
|||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Get metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
images: |
|
||||
jrasanen/writefreely
|
||||
ghcr.io/${{ github.repository }}
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v5
|
||||
|
@ -52,5 +54,11 @@ jobs:
|
|||
file: ./Dockerfile
|
||||
push: true
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
build-args: |
|
||||
WRITEFREELY_VERSION=${{ env.WRITEFREELY_VERSION }}
|
||||
tags: |
|
||||
${{ env.DOCKERHUB_REPO }}:${{ env.WRITEFREELY_VERSION }}
|
||||
${{ env.DOCKERHUB_REPO }}:latest
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue