Skip to content

Commit

Permalink
Stop trying to rebuild and just pull from GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
DRuggeri committed Sep 4, 2021
1 parent 06f39d3 commit 12af0f9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ jobs:
echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV
echo "TAG=$TAG" >> $GITHUB_ENV
echo "URL_LINUX_AMD64=https://github.com/${GITHUB_REPOSITORY}/releases/download/$TAG/${PROJECT_NAME}-${TAG}-linux-amd64" >> $GITHUB_ENV
echo "URL_LINUX_ARM64=https://github.com/${GITHUB_REPOSITORY}/releases/download/$TAG/${PROJECT_NAME}-${TAG}-linux-arm64" >> $GITHUB_ENV
echo "URL_LINUX_ARM=https://github.com/${GITHUB_REPOSITORY}/releases/download/$TAG/${PROJECT_NAME}-${TAG}-linux-arm" >> $GITHUB_ENV
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down Expand Up @@ -110,11 +113,14 @@ jobs:
run: |
echo "
FROM golang:1.17.0-alpine3.14 AS builder
RUN apk --no-cache add git
RUN go install github.com/${{ github.repository }}@$TAG
RUN apk --no-cache add wget
RUN if uname -m | grep 'x86_64' >/dev/null 2>&1; then wget -O /downloaded_file $URL_LINUX_AMD64;fi \
&& if uname -m | grep 'aarch64' >/dev/null 2>&1; then wget -O /downloaded_file $URL_LINUX_ARM64;fi \
&& if uname -m | grep 'arm' >/dev/null 2>&1; then wget -O /downloaded_file $URL_LINUX_ARM;fi \
&& if [ ! -f /downloaded_file ];then echo "===Failed to download for:";uname -m;echo "===";exit 1;fi
FROM scratch
COPY --from=builder /go/bin/$PROJECT_NAME /$PROJECT_NAME
COPY --from=builder /downloaded_file /$PROJECT_NAME
ENTRYPOINT [\"/$PROJECT_NAME\"]
" > Dockerfile
Expand All @@ -125,7 +131,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 12af0f9

Please sign in to comment.