Skip to content

Commit

Permalink
ci: build docker image and push to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
libotony committed Jul 8, 2021
1 parent a0c0f6a commit 5082178
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build_docker.yaml
@@ -0,0 +1,33 @@
name: Push docker images

on:
push:
tags:
- 'v*'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Get docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: libotony/vechain
tags: |
type=ref,event=tag
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
5 changes: 1 addition & 4 deletions Dockerfile
Expand Up @@ -2,11 +2,8 @@
FROM golang:alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git


RUN git clone https://github.com/vechain/thor.git
WORKDIR /go/thor
RUN git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
COPY . /go/thor
RUN make all

# Pull thor into a second stage deploy alpine container
Expand Down

0 comments on commit 5082178

Please sign in to comment.