Skip to content

Commit 47ed7c2

Browse files
committed
Update CI
1 parent 6af5c3d commit 47ed7c2

File tree

3 files changed

+31
-41
lines changed

3 files changed

+31
-41
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,29 @@ jobs:
5454
args: release --rm-dist
5555
env:
5656
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
57-
#
58-
# - name: Cache Docker layers
59-
# uses: actions/cache@v2
60-
# with:
61-
# path: /tmp/.buildx-cache
62-
# key: ${{ runner.os }}-nginx-errors-buildx
63-
#
64-
# - name: Build and push
65-
# uses: docker/build-push-action@v2
66-
# with:
67-
# context: .
68-
# push: true
69-
# labels: |
70-
# org.label-schema.schema-version=1.0
71-
# org.label-schema.version=v${{ github.event.inputs.version }}
72-
# org.label-schema.name=nginx-errors
73-
# tags: |
74-
# vietanhs0817/nginx-errors:v${{ github.event.inputs.version }}
75-
# vietanhs0817/nginx-errors:latest
76-
# cache-from: type=local,src=/tmp/.buildx-cache
77-
# cache-to: type=local,dest=/tmp/.buildx-cache-new
78-
#
79-
# - name: Move cache
80-
# run: |
81-
# rm -rf /tmp/.buildx-cache
82-
# mv /tmp/.buildx-cache-new /tmp/.buildx-cache
57+
58+
- name: Cache Docker layers
59+
uses: actions/cache@v2
60+
with:
61+
path: /tmp/.buildx-cache
62+
key: ${{ runner.os }}-nginx-errors-buildx
63+
64+
- name: Build and push
65+
uses: docker/build-push-action@v2
66+
with:
67+
context: .
68+
push: true
69+
labels: |
70+
org.label-schema.schema-version=1.0
71+
org.label-schema.version=v${{ github.event.inputs.version }}
72+
org.label-schema.name=nginx-errors
73+
tags: |
74+
vietanhs0817/nginx-errors:v${{ github.event.inputs.version }}
75+
vietanhs0817/nginx-errors:latest
76+
cache-from: type=local,src=/tmp/.buildx-cache
77+
cache-to: type=local,dest=/tmp/.buildx-cache-new
78+
79+
- name: Move cache
80+
run: |
81+
rm -rf /tmp/.buildx-cache
82+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.goreleaser.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@ builds:
1313
archives:
1414
- files:
1515
- README.md
16-
dockers:
17-
- skip_push: false
18-
dockerfile: Dockerfile
19-
use: buildx
20-
image_templates:
21-
- "vietanhs0817/nginx-errors:v{{ .Tag }}"
22-
- "vietanhs0817/nginx-errors:latest"
23-
build_flag_templates:
24-
- --label=org.label-schema.schema-version=1.0
25-
- --label=org.label-schema.version={{ .Version }}
26-
- --label=org.label-schema.name={{ .ProjectName }}
27-
- --label=org.label-schema.build-date={{ .Date }}
2816
checksum:
2917
name_template: 'checksums.txt'
3018
snapshot:

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ FROM golang:1.16.5-alpine as builder
22

33
WORKDIR /src
44

5-
COPY . .
5+
COPY go.mod .
66

77
RUN go mod download
88

9-
RUN GO111MODULE=off CGO_ENABLED=0 GOOS=linux go build -o nginx-errors .
9+
COPY . .
10+
11+
RUN CGO_ENABLED=0 GOOS=linux go build -o nginx-errors .
1012

1113
FROM debian:stretch
1214

@@ -18,6 +20,6 @@ RUN apt-get update && \
1820

1921
COPY --from=builder /src/nginx-errors .
2022

21-
COPY ./www /www
23+
COPY www www
2224

2325
ENTRYPOINT ["/nginx-errors"]

0 commit comments

Comments
 (0)