forked from partkeepr/PartKeepr
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (43 loc) · 1.87 KB
/
docker.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
51
52
53
name: Docker Image Creation
on:
push:
branches:
- master
tags:
- '**'
jobs:
base-image:
runs-on: ubuntu-latest
name: Create the base image
steps:
- uses: actions/checkout@v2
- name: Fetch git tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Build the base docker image
run: docker pull partkeepr/base-dev:latest && docker build docker/base-dev --file docker/base-dev/Dockerfile --cache-from partkeepr/base-dev:latest --tag partkeepr/base-dev:latest
- name: Tag the base docker image with git hash
run: docker tag partkeepr/base-dev:latest partkeepr/base-dev:$(git describe)
- name: Deploy the base docker images
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
docker push partkeepr/base-dev:latest
docker push partkeepr/base-dev:$(git describe)
development-image:
runs-on: ubuntu-latest
needs: base-image
name: Create the development image
steps:
- uses: actions/checkout@v2
- name: Fetch git tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Build development image
run: |
docker pull partkeepr/development:latest
docker build docker/development/app --file docker/development/app/Dockerfile --tag partkeepr/development:latest --build-arg SRC_IMAGE=partkeepr/base-dev:$(git describe) --cache-from partkeepr/development:latest
- name: Tag the development docker image with git hash
run: docker tag partkeepr/development:latest partkeepr/development:$(git describe)
- name: Deploy the development docker images
run: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }}
docker push partkeepr/development:latest
docker push partkeepr/development:$(git describe)