forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1019 Bytes
/
Copy pathmain.yml
File metadata and controls
32 lines (30 loc) · 1019 Bytes
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
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@v1
with:
registry: registry.hub.docker.com
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_TOKEN }}
- name: create and push an image
run: |
chmod +x ./build.sh
if [ "${GITHUB_REF##*/}" == "master" ]; then
VERSION="2.5.${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
sudo ./build.sh "registry.hub.docker.com" "wurstbrot" "dsomm" "${VERSION}" "${{ secrets.HUB_USERNAME }}" "${{ secrets.HUB_TOKEN }}"