Build docker image as part of CI (#527)

We only publish on tag, but we want to build and test the image
on all PRs.
This commit is contained in:
Sam Clegg
2020-06-22 16:09:09 -07:00
committed by GitHub
parent 27b23d467d
commit 7241082595

View File

@@ -91,15 +91,37 @@ jobs:
python scripts/test.py python scripts/test.py
build-docker-image: build-docker-image:
machine: true executor: bionic
steps: steps:
- checkout - checkout
- run: docker build --network host --build-arg=EMSCRIPTEN_VERSION=${CIRCLE_TAG}-upstream --tag emscripten/emsdk:${CIRCLE_TAG} ./docker - run:
- run: docker tag emscripten/emsdk:${CIRCLE_TAG} emscripten/emsdk:latest name: install docker
- run: | command: apt-get update -q && apt-get install -q -y docker.io
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" - setup_remote_docker
docker push emscripten/emsdk:${CIRCLE_TAG} - run:
docker push emscripten/emsdk:latest name: build
command: docker build --network host ./docker
publish-docker-image:
executor: bionic
steps:
- checkout
- run:
name: install docker
command: apt-get update -q && apt-get install -q -y docker.io
- setup_remote_docker
- run:
name: build
command: docker build --network host --build-arg=EMSCRIPTEN_VERSION=${CIRCLE_TAG}-upstream --tag emscripten/emsdk:${CIRCLE_TAG} ./docker
- run:
name: tag image
command: docker tag emscripten/emsdk:${CIRCLE_TAG} emscripten/emsdk:latest
- run:
name: push image
command: |
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
docker push emscripten/emsdk:${CIRCLE_TAG}
docker push emscripten/emsdk:latest
workflows: workflows:
flake8: flake8:
@@ -116,7 +138,8 @@ workflows:
- test-windows - test-windows
build-docker-image: build-docker-image:
jobs: jobs:
- build-docker-image: - build-docker-image
- publish-docker-image:
filters: filters:
branches: branches:
ignore: /.*/ ignore: /.*/