-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Running action as “composite” works, but actions/setup-go@v5 action cannot cache Go dependencies because go.sum is outside workspace: > [debug]Ignore '/home/runner/work/_actions/artyom/update-cloudformation-stack/main/go.sum' since it is not under GITHUB_WORKSPACE. Make this action rely on the prebuilt docker image instead.
- Loading branch information
Showing
4 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build and publish docker image | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: publish | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
- uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
platforms: | | ||
linux/arm64 | ||
linux/amd64 | ||
tags: | | ||
ghcr.io/artyom/update-cloudformation-stack:latest | ||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=6,force-compression=true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:alpine AS builder | ||
WORKDIR /app | ||
ENV CGO_ENABLED=0 GOTOOLCHAIN=auto | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . . | ||
ARG TARGETOS TARGETARCH | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o main | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /app/main / | ||
ENTRYPOINT ["/main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters