Skip to content

Merge pull request #17 from eval-exec/exec/upgrade-openssl-3.1.3 #41

Merge pull request #17 from eval-exec/exec/upgrade-openssl-3.1.3

Merge pull request #17 from eval-exec/exec/upgrade-openssl-3.1.3 #41

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]
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]
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]
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 }}