mirror of
https://github.com/TeamPiped/http3-ytproxy.git
synced 2024-08-14 23:56:43 +00:00
Use BuildX's cache mount for caching.
This commit is contained in:
parent
779777b9b6
commit
e44f1e55b7
2 changed files with 4 additions and 12 deletions
13
.github/workflows/docker-build.yml
vendored
13
.github/workflows/docker-build.yml
vendored
|
@ -26,15 +26,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Get hash of latest image
|
|
||||||
run: docker pull golang:alpine && docker inspect --format='{{index .RepoDigests 0}}' golang:alpine > dockerhash.txt
|
|
||||||
- name: cache docker cache
|
|
||||||
uses: actions/cache@v2.1.2
|
|
||||||
with:
|
|
||||||
path: ${{ github.workspace }}/cache
|
|
||||||
key: ${{ runner.os }}-docker-${{ hashFiles('**/go.mod') }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/dockerhash.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-docker-
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
@ -43,5 +34,5 @@ jobs:
|
||||||
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
|
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
|
||||||
push: true
|
push: true
|
||||||
tags: 1337kavin/ytproxy:latest
|
tags: 1337kavin/ytproxy:latest
|
||||||
cache-from: type=local,src=cache
|
cache-from: type=gha
|
||||||
cache-to: type=local,dest=cache
|
cache-to: type=gha,mode=max
|
||||||
|
|
|
@ -4,7 +4,8 @@ WORKDIR /app/
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN go build -ldflags "-s -w" main.go
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
go build -ldflags "-s -w" main.go
|
||||||
|
|
||||||
FROM alpine:edge
|
FROM alpine:edge
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue