-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.34 KB
/
ci-cd.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
name: Continuous
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
integration:
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-v1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-v1-
- name: Build
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
load: true
tags: streamr/nginx:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
delivery:
name: Delivery
needs:
- integration
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
driver-opts: |
network=host
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-v1-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-v1-
- name: Docker meta
id: docker_meta
uses: docker/[email protected]
with:
images: streamr/nginx
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
flavor: |
latest=auto
- name: Login to Docker Hub Container Registry
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push container to Docker Hub
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
load: false
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache