Skip to content

include aarch64 in workflow docker.yml #43

include aarch64 in workflow docker.yml

include aarch64 in workflow docker.yml #43

Workflow file for this run

name: Docker
on:
push:
branches:
- master
tags:
- "*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
distro: [centos-7, bionic, aarch64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USERNAME }}
password: ${{ secrets.CR_PAT }}
- name: Build
uses: docker/build-push-action@v2
with:
file: ${{ matrix.distro }}/Dockerfile
context: .
push: true
tags: ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-${{ github.sha }}
test:
name: Test
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
distro: [centos-7, bionic, aarch64]
steps:
- name: Checkout CKB
uses: actions/checkout@v2
with:
repository: nervosnetwork/ckb
path: ckb
- name: Build CKB
run: |
docker run --rm -i -w /ckb -v $(pwd)/ckb:/ckb ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-${{ github.sha }} make prod
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
if: ${{ startsWith(github.ref, 'refs/tags/') }}
strategy:
matrix:
distro: [centos-7, bionic, aarch64]
steps:
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USERNAME }}
password: ${{ secrets.CR_PAT }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Determine tag
id: tag
run: echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Tag and push image
run: |
SRC_TAG=ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-${{ github.sha }}
docker pull "$SRC_TAG"
docker tag "$SRC_TAG" ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-latest
docker push ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-latest
docker tag "$SRC_TAG" ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-${{ steps.tag.outputs.tag }}
docker push ghcr.io/nervosnetwork/ckb-docker-builder:${{ matrix.distro }}-${{ steps.tag.outputs.tag }}
docker tag "$SRC_TAG" nervos/ckb-docker-builder:${{ matrix.distro }}-latest
docker push nervos/ckb-docker-builder:${{ matrix.distro }}-latest
docker tag "$SRC_TAG" nervos/ckb-docker-builder:${{ matrix.distro }}-${{ steps.tag.outputs.tag }}
docker push nervos/ckb-docker-builder:${{ matrix.distro }}-${{ steps.tag.outputs.tag }}