mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-09-03 15:40:53 +02:00
add docker multistage build
This commit is contained in:
parent
f0fe8d1cf6
commit
00008c553d
2 changed files with 69 additions and 0 deletions
31
.github/workflows/docker.yml
vendored
Normal file
31
.github/workflows/docker.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- add-docker-build
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build docker images
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: build-test-image
|
||||
run: docker build -f ./docker/Dockerfile -t modern-cpp-starter/greeter-test:1.0 --target test .
|
||||
|
||||
- name: build-app-image
|
||||
run: docker build -f ./docker/Dockerfile -t modern-cpp-starter/greeter-app:1.0 .
|
||||
|
||||
- name: run-test-image
|
||||
run: docker run modern-cpp-starter/greeter-test:1.0
|
||||
|
||||
- name: run-app-image
|
||||
run: docker run modern-cpp-starter/greeter-app:1.0
|
Loading…
Add table
Add a link
Reference in a new issue