forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.89 KB
/
main.yml
File metadata and controls
54 lines (50 loc) · 1.89 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
47
48
49
50
51
52
53
54
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
#registry: registry.hub.docker.com
username: wurstbrot
password: ${{ secrets.HUB_TOKEN }}
- name: create and push an image
run: |
if [ "${GITHUB_REF##*/}" == "master" ]; then
VERSION="3.0.0-${GITHUB_RUN_NUMBER}"
else
BRANCH_TO_DOCKER=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]//g')
VERSION="${BRANCH_TO_DOCKER}-${GITHUB_RUN_NUMBER}"
fi
docker build -t wurstbrot/dsomm-yaml-generation:latest -f Dockerfile-yaml .
docker push wurstbrot/dsomm-yaml-generation:latest
docker tag wurstbrot/dsomm-yaml-generation:latest wurstbrot/dsomm-yaml-generation:${VERSION}
docker push wurstbrot/dsomm-yaml-generation:${VERSION}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
#registry: registry.hub.docker.com
username: wurstbrot
password: ${{ secrets.HUB_TOKEN }}
- name: create and push an image
run: |
if [ "${GITHUB_REF##*/}" == "master" ]; then
VERSION="3.0.0-${GITHUB_RUN_NUMBER}"
else
BRANCH_TO_DOCKER=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]//g')
VERSION="${BRANCH_TO_DOCKER}-${GITHUB_RUN_NUMBER}"
fi
docker build -t wurstbrot/dsomm:latest .
docker push wurstbrot/dsomm:latest
docker tag wurstbrot/dsomm:latest wurstbrot/dsomm:${VERSION}
docker push wurstbrot/dsomm:${VERSION}