Skip to content

Commit

Permalink
build: Optimise Docker build (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurdotb authored Aug 15, 2022
1 parent 4517a19 commit a5aef25
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
**/*.md

# Skip build/test folders
build-tools/
installer/
networks/
tests/
build-tools/**
installer/**
networks/**
tests/**

# Skip Git-related folders
.github
.git
.github/**
**/.git
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ jobs:
go-version-file: ./go.mod
cache: true

- name: Generate Protobufs
run: make proto-gen

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
Expand All @@ -34,6 +35,10 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# Setup for pushing to Buf.build later
- uses: bufbuild/buf-setup-action@v1.7.0

# Required for short-lived token provided to Semantic Release
- name: "Obtain Github App token"
id: app-token
uses: getsentry/action-github-app-token@v1.0.6
Expand Down Expand Up @@ -64,6 +69,12 @@ jobs:
RELEASE_VERSION=$( git describe --tags ${{ github.sha }})
echo ::set-output name=RELEASE_VERSION::"$RELEASE_VERSION"
# Push Protobufs to Buf.build registry
- uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}

release-docker:
name: "Docker image"
needs: release-binary
Expand All @@ -73,15 +84,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

- name: Generate golang code
run: make proto-gen

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ checksum:
algorithm: sha256

changelog:
use: github
use: github-native
sort: asc
groups:
- title: Features
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WORKDIR /go/src/github.com/cheqd/cheqd-node
COPY . .

# Make node binary
RUN make install && make build
RUN go mod download && make build-linux

###############################################################
### STAGE 2: Build cheqd-node image ###
Expand Down
Empty file added proto/buf.md
Empty file.
4 changes: 2 additions & 2 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Buf Build config for cheqd-node DID module
# Buf Build config for cheqd Cosmos SDK modules

version: v1

name: buf.build/cheqd/cheqd-node
name: buf.build/cheqd/cheqd-proto

deps:
- buf.build/cosmos/cosmos-sdk
Expand Down

0 comments on commit a5aef25

Please sign in to comment.