New CLI version #107
This file contains 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: Check and build Dockerfile | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
concurrency: | |
group: ${{ | |
( github.ref == 'refs/heads/master' && | |
format('{0}/{1}', github.run_id, github.run_attempt) ) | |
|| | |
format('{0}/{1}', github.workflow, github.ref) }} | |
cancel-in-progress: true | |
env: | |
IMAGE_NAME: ghcr.io/nilfoundation/proof-market-toolchain | |
jobs: | |
build-image: | |
runs-on: [ self-hosted, aws_autoscaling ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: .github/filters.yml | |
# If the base image didn't change, use one from registry | |
- name: Pull ${{ env.IMAGE_NAME }}:base | |
if: steps.changes.outputs.dockerfile-base == 'false' | |
run: docker pull ${{ env.IMAGE_NAME }}:base || true | |
# If the base image has changed, build it from scratch | |
- name: Rebuild ${{ env.IMAGE_NAME }}:base | |
if: steps.changes.outputs.dockerfile-base == 'true' | |
run: docker build -t ${{ env.IMAGE_NAME }}:base --file Dockerfile.base . | |
- name: Rebuild ${{ env.IMAGE_NAME }}:latest | |
run: docker build -t ${{ env.IMAGE_NAME }}:latest . |