Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
rename docker build action step
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Nov 11, 2023
1 parent ce15b0a commit d1b1163
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/buiild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
run: |
# tag is branch name or tag if there is a tag
echo ::set-output name=image_tag::${GITHUB_REF##*/}
echo ::set-output name=do_push::true
- name: Cache Docker layers
uses: actions/cache@v3
Expand All @@ -39,23 +38,13 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3

- name: Build developer image
- name: Build image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
push: ${{ steps.tag.outputs.do_push }}
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}
# - name: Build runtime image
# uses: docker/build-push-action@v5
# with:
# builder: ${{ steps.buildx.outputs.name }}
# push: ${{ steps.tag.outputs.do_push }}
# tags: |
# ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.image_tag }}.run
# target: runtime
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ RUN git clone https://github.com/neilpa/yajsv.git && \
cd yajsv && \
git checkout 9889895863c595d38aa5d6347dfadb99f2687a51^{commit}

RUN cd /go/yajsv && go build -o /yajsv
# use turn off cgo to build a static binary
ENV CGO_ENABLED=0
RUN cd yajsv && go build -o /yajsv.bin

FROM alpine:3.18.4 as runtime

COPY --from=build /yajsv /yajsv
COPY --from=build /yajsv.bin /yajsv

ENTRYPOINT ["/yajsv"]

0 comments on commit d1b1163

Please sign in to comment.