-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (35 loc) · 1.11 KB
/
executeImage.yml
File metadata and controls
46 lines (35 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Executing Docker Image
on: [push, workflow_dispatch]
jobs:
executeimage:
runs-on: ubuntu-latest
steps:
- name: OS
run: uname -a
- name: Downloading repository ...
uses: actions/checkout@v2
- name: Login to Docker hub ...
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{secrets.DOCKER_HUB_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_HUB_TOKEN}}
- name: Build
if: success()
run: |
echo "[DOCKER] BUILDING ..."
IMAGE_NAME=gh01
docker build -f Dockerfile -t $IMAGE_NAME:1.0 .
docker images
echo "[DOCKER] CREATING ..."
CONTAINER_ID=$(docker create ${IMAGE_NAME}:1.0)
echo "[DOCKER] EXECUTING ..."
docker cp ${CONTAINER_ID}:/home/jovyan/work/from_docker.ipynb ./
docker rm -v $CONTAINER_ID
echo "[DOCKER] DONE!"
- name: Saving artifacts ...
uses: actions/upload-artifact@v2
with:
name: FromContainer
if-no-files-found: error
path: ./from_docker.ipynb
retention-days: 1