-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (79 loc) · 2.66 KB
/
images.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
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
85
86
87
88
# A workflow to build and publish sdx-controllera container images.
# See https://docs.docker.com/build/ci/github-actions/.
name: Container images
on:
push:
branches:
- "main"
tags:
- "*"
# Triggering the build/publish of container images on pull
# requests should be here only for testing, keep "pull_request"
# disabled.
# pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Collect metadata for container image tags
# See https://github.com/docker/metadata-action
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
awsdx/sdx-controller
awsdx/bapm-server
# ghcr.io/username/app
# generate Docker tags based on the following events/attributes
tags: |
type=pep440,pattern={{version}}
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# Secrets used here are set under "repository secrets" at
# https://github.com/atlanticwave-sdx/sdx-controller/settings/secrets/actions,
#
# # See https://github.com/docker/login-action.
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Buildx is a Docker CLI plugin for extended build capabilities
# with BuildKit.
#
# See https://github.com/docker/setup-buildx-action.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# See https://github.com/docker/build-push-action
- name: Build and push sdx-controller
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: |
awsdx/sdx-controller:latest
awsdx/sdx-controller:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
# See https://github.com/docker/build-push-action
- name: Build and push bapm-server
uses: docker/build-push-action@v4
with:
context: ./bapm_server
file: ./bapm_server/Dockerfile
push: true
tags: |
awsdx/bapm-server:latest
awsdx/bapm-server:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}