Browse Source

Automate multi arch builds on GitHub Actions (#65)

master
Luke Childs 3 years ago
committed by GitHub
parent
commit
ae0dcbb302
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      .github/workflows/on-master-push.yml
  2. 7
      .travis.yml
  3. 8
      Dockerfile
  4. 1
      VERSION

39
.github/workflows/on-master-push.yml

@ -0,0 +1,39 @@
name: Build on master push
on:
push:
branches:
- master
env:
DOCKER_CLI_EXPERIMENTAL: enabled
jobs:
build:
name: Build Docker image
runs-on: ubuntu-18.04
env:
VERSION: 1.16.0
steps:
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u lukechilds --password-stdin
- name: Checkout project
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
id: qemu
- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
id: buildx
- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=$VERSION \
--tag lukechilds/electrumx:v$VERSION \
--tag lukechilds/electrumx:latest \
--output "type=registry" .

7
.travis.yml

@ -1,7 +0,0 @@
sudo: required
services:
- docker
script: docker build -t electrumx .
notifications:
email:
on_success: never

8
Dockerfile

@ -1,11 +1,13 @@
ARG VERSION=1.16.0
FROM python:3.7-alpine3.11 FROM python:3.7-alpine3.11
LABEL maintainer="Luke Childs <lukechilds123@gmail.com>" LABEL maintainer="Luke Childs <lukechilds123@gmail.com>"
ARG VERSION
COPY ./bin /usr/local/bin COPY ./bin /usr/local/bin
COPY ./VERSION /tmp
RUN VERSION=$(cat /tmp/VERSION) && \ RUN chmod a+x /usr/local/bin/* && \
chmod a+x /usr/local/bin/* && \
apk add --no-cache git build-base openssl && \ apk add --no-cache git build-base openssl && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev && \ apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev && \ apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev && \

1
VERSION

@ -1 +0,0 @@
1.16.0
Loading…
Cancel
Save