Skip to content

Commit

Permalink
Submit docker image at once
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi authored Sep 9, 2024
1 parent 3f7b42e commit 56afb95
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/builddockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ jobs:
strategy:
matrix:
arch: ["arm64", "amd64"]
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -35,6 +28,30 @@ jobs:
GOOS: linux
GOARCH: ${{ matrix.arch }}
run: go build cmd/service/main.go
- uses: actions/upload-artifact@v4
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: binary-${{ matrix.arch }}

# A file, directory or wildcard pattern that describes what to upload
# Required.
path: main
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: binary-amd64
path: amd64
- uses: actions/download-artifact@v4
with:
name: binary-arm64
path: arm64
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM --platform=$TARGETOS/$TARGETARCH alpine
RUN apk --no-cache add ca-certificates

WORKDIR /root/
COPY main .
COPY $TARGETARCH/main .

CMD ["/root/main"]

0 comments on commit 56afb95

Please sign in to comment.