BUILD IMAGE FROM TEMPLATE #157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |