Skip to content

Commit

Permalink
feat: use docker for starred
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Jan 22, 2023
1 parent 38d8e4c commit bd04e17
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,26 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push image
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/juev/starred:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
13 changes: 7 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ builds:
- windows
- darwin
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
-
format: binary
name_template: >-
{{ .ProjectName }}-
{{- .Os }}-
{{- if eq .Arch "amd64" }}amd64
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM bash:latest

ARG TARGETARCH="amd64"
ARG TARGETOS="linux"
ARG TARGETPLATFORM="linux/amd64"

ARG USER_UID=1001

ADD https://github.com/juev/starred/releases/latest/download/starred-linux-amd64 /usr/local/bin/starred

RUN set -eux; \
\
apk add --no-cache curl; \
rm -rf /var/cache/apk; \
\
adduser -D runner -u $USER_UID; \
chmod +rx /usr/local/bin/starred;

USER runner

0 comments on commit bd04e17

Please sign in to comment.