Skip to content

Commit

Permalink
deployment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Aug 25, 2024
1 parent 0f4a50e commit f7db951
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.git
!dist
13 changes: 6 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write
Expand All @@ -23,10 +24,8 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: sudorandom/app:latest

- name: Push
run: |
docker push --all-tags sudorandom/fauxrpc:latest
docker push --all-tags sudorandom/fauxrpc:latest
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
strategy:
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/publish.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
tmp
tmp
dist
28 changes: 28 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
version: 2
project_name: fauxrpc
builds:
- main: ./cmd/fauxrpc/
dockers:
- image_templates:
- "docker.io/sudorandom/fauxrpc:{{ .Tag }}-amd64"
- "docker.io/sudorandom/fauxrpc:{{ .Tag }}"
- "docker.io/sudorandom/fauxrpc:v{{ .Major }}"
- "docker.io/sudorandom/fauxrpc:latest"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- image_templates:
- "docker.io/sudorandom/fauxrpc:{{ .Tag }}-arm64"
- "docker.io/sudorandom/fauxrpc:{{ .Tag }}"
- "docker.io/sudorandom/fauxrpc:v{{ .Major }}"
- "docker.io/sudorandom/fauxrpc:latest"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
goarch: arm64
checksum:
# https://goreleaser.com/customization/checksum/
name_template: 'checksums.txt'
source:
# https://goreleaser.com/customization/source/
enabled: true
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
FROM golang:latest as builder
ARG CGO_ENABLED=0
WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download
COPY . .

RUN go build ./cmd/fauxrpc/

FROM scratch
COPY --from=builder /app/fauxrpc /fauxrpc
ENTRYPOINT ["/fauxrpc"]
ENTRYPOINT ["/fauxrpc"]
COPY fauxrpc /

0 comments on commit f7db951

Please sign in to comment.