-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 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,52 @@ | ||
name: Publish docker images of client | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # each 12:00 UTC | ||
push: | ||
branches: [ main ] | ||
tags: [ 'v*.*.*' ] # semver release | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
IMAGE: stores-client | ||
|
||
jobs: | ||
|
||
build-container: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Log into registry ghcr.io | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=schedule,pattern=nightly | ||
type=raw,latest | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "." | ||
file: Dockerfile-client | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 |
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,10 @@ | ||
FROM golang:1.22.5 as builder | ||
WORKDIR /app | ||
COPY . ./ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -v -o stores-client ./cmd/stores-client | ||
|
||
FROM alpine:3 | ||
RUN apk add --no-cache ca-certificates | ||
COPY --from=builder /app/stores-client /usr/local/bin/stores-client | ||
COPY --from=builder /app/roots.pem /roots.pem | ||
ENTRYPOINT ["/usr/local/bin/stores-client"] |