Skip to content

Commit

Permalink
build: add gitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
MaoWei committed Aug 30, 2021
1 parent 32bc9e3 commit c0d1832
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docker-build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: build docker image dev
on:
push:
branches:
- main
tags-ignore:
- v*
paths-ignore:
- 'docs/**'
- '.github/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: deltampc/delta-chain:dev
34 changes: 34 additions & 0 deletions .github/workflows/docker-build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build docker image release
on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: deltampc/delta-chain
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Docker build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ WORKDIR /delta
COPY --from=builder /delta/target/release/delta-chain-node ./node

# Shrinking
RUN rm -rf /usr/lib/python* && \
rm -rf /usr/bin /usr/sbin /usr/share/man
RUN rm -rf /usr/lib/python*

# 30333 for p2p traffic
# 9933 for RPC call
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
alice:
build: .
container_name: delta-chain-alice
image: deltampc/delta-chain:0.0.1
image: deltampc/delta-chain:dev
command:
- --validator
- --unsafe-ws-external
Expand All @@ -13,8 +13,8 @@ services:
- Unsafe
- --name
- Alice
- --node-key
- $AliceNodeKey
- --node-key-file
- /root/.local/node-key
ports:
- "9944:9944"
- "9933:9933"
Expand All @@ -24,7 +24,7 @@ services:
target: /root/.local
bob:
container_name: delta-chain-bob
image: deltampc/delta-chain:0.0.1
image: deltampc/delta-chain:dev
command:
- --validator
- --unsafe-ws-external
Expand All @@ -39,8 +39,8 @@ services:
- "9945"
- --rpc-port
- "9934"
- --node-key
- $BobNodeKey
- --node-key-file
- /root/.local/node-key
- --bootnodes
- /dns/alice/tcp/30333/p2p/12D3KooWKpxeRfkRPmCQUb9PCBVPgdo139n3g8SNAKE3Ap4V6bWy
ports:
Expand Down

0 comments on commit c0d1832

Please sign in to comment.