Skip to content

BUILD IMAGE FROM TEMPLATE #157

BUILD IMAGE FROM TEMPLATE

BUILD IMAGE FROM TEMPLATE #157

Workflow file for this run

name: BUILD IMAGE FROM TEMPLATE
on:
workflow_dispatch:
inputs:
image:
description: The full name of the wallet. Example - bitcoin, dash, blocknet.
required: true
version:
description: Tag or version of an image, please check manifest-latest.json. By default it takes the newest version.
required: false
default: latest
path:
description: Full raw path of a branch where the config can be found.
required: false
default: https://raw.githubusercontent.com/blocknetdx/blockchain-configuration-files/master
repo:
description: DockerHub repo name.
required: true
default: blocknetdx
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
run: echo ${{ secrets.org_blocknetdximg_password }} | docker login --username ${{ secrets.org_blocknetdximg_username }} --password-stdin
# Build images
- name: INFO BUILD
run: echo ${{ github.event.inputs.path }} ${{ github.event.inputs.image }} ${{ github.event.inputs.version }}
- name: generate a Dockerfile
run: ./ci.sh generate "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}" "${{ github.event.inputs.path }}"
- name: build an image
run: ./ci.sh build "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}" "*" "${{ github.event.inputs.repo }}"
- name: Run a container
run: ./ci.sh run "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}" "*" "${{ github.event.inputs.repo }}"
- name: Test build
run: ./ci.sh test "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}" "${{ github.event.inputs.path }}"
- name: Remove a container
run: ./ci.sh clean "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}"
- name: Remove dangling images
if: ${{ always() }}
run: yes | docker image prune
- name: Push an image to DockerHub
run: ./ci.sh push "${{ github.event.inputs.image }}" "${{ github.event.inputs.version }}" "*" "${{ github.event.inputs.repo }}"
# staging:
# if: ${{ github.event.pull_request }}
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Test new image
# run: echo "Some test"