-
Notifications
You must be signed in to change notification settings - Fork 16
50 lines (45 loc) · 1.26 KB
/
build-pipeline.yml
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
47
48
49
50
name: Docker Image CI
on: [push]
# Environment variables available to all jobs and steps in this workflow
env: # Or as an environment variable
docker_username: ${{ secrets.DOCKER_USER }}
docker_password: ${{ secrets.DOCKER_PW }}
jobs:
test-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Upload workspace
uses: actions/upload-artifact@v1
with:
name: workspace
path: .
- name: Test the code
run: ./unit-test.sh
build-docker-image:
runs-on: ubuntu-latest
needs: test-code
steps:
- name: Download workspace
uses: actions/download-artifact@v1
with:
name: workspace
path: .
- name: Build the Docker image
run: . build-app.sh
- name: Login to Docker
run: echo "$docker_password" | docker login -u "$docker_username" --password-stdin
- name: Push the docker image
run: . push-app.sh
component-test-docker-image:
runs-on: ubuntu-latest
needs: build-docker-image
steps:
- name: Download workspace
uses: actions/download-artifact@v1
with:
name: workspace
path: .
- name: Run the component tests
run: . component-test.sh
working-directory: ./test