Skip to content

Commit

Permalink
ready
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Knecht committed Sep 29, 2023
1 parent ae98440 commit 2ce6ba1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ env:
then
echo "::error::Docker-Build Error. $arch Cache will be deleted now!"
rm -rf /home/runner/tmp/$arch/
fi
}
check_if_safe_to_use_cache: |-
check_if_safe_to_use_cache() {
if [ -d "/home/runner/tmp/amd64" ] && [ -d "/home/runner/tmp/arm64" ]; then
cache="--cache-from type=local,src=/home/runner/tmp/amd64 --cache-from type=local,src=/home/runner/tmp/arm64"
else
cache="--no-cache"
docker buildx prune -a -f
fi
}
Expand Down Expand Up @@ -84,26 +76,21 @@ jobs:
${{ env.build_and_cache }}
build_and_cache arm64
- name: Docker build from cache and push
- name: Docker build (from cache) and push
if: fromJSON(env.should_push_image)
run: |
${{ env.check_if_safe_to_use_cache }}
check_if_safe_to_use_cache
echo "We will use: $cache"
docker buildx build --push \
$cache --platform linux/amd64,linux/arm64 \
--platform linux/amd64,linux/arm64 \
--tag ${GITHUB_REPOSITORY,,}:${{ steps.compute_docker_tag.outputs.DOCKER_TAG }} \
--file Dockerfile .
- name: Docker build from cache & push latest
- name: Docker build (from cache) & push latest
if: |
github.event_name == 'push' && (
startsWith(github.event.ref, 'refs/tags/')
)
run: |
${{ env.check_if_safe_to_use_cache }}
check_if_safe_to_use_cache
docker buildx build --push \
$cache --platform linux/amd64,linux/arm64 \
--platform linux/amd64,linux/arm64 \
--tag ${GITHUB_REPOSITORY,,}:latest \
--file Dockerfile .
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY . .
ENV GOOS=linux
ENV CGO_ENABLED=0

RUN o get -d -v ./...
RUN go get -d -v ./...
RUN go install -v ./...

#RUN ls -lart && go build -o /go/bin/gargantua main.go
Expand Down

0 comments on commit 2ce6ba1

Please sign in to comment.