File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build images and push (on master branch or on schedule)
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ schedule :
8+ - cron : ' 0 0 1 * *'
9+ workflow_dispatch :
10+
11+ jobs :
12+ push :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@master
16+ - name : Run CI
17+ run : |
18+ echo ${{ secrets.DH_PW }} | docker login -u ${{ secrets.DH_USER }} --password-stdin
19+ docker build -t ppiper/cf-cli:latest .
20+ docker push ppiper/cf-cli:latest
Original file line number Diff line number Diff line change 1+ name : Create new Release
2+
3+ on :
4+ repository_dispatch :
5+ types : perform-release
6+ workflow_dispatch :
7+
8+ jobs :
9+ create-release :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v1
13+ - name : Prepare Release
14+ run : |
15+ CURRENT_VERSION_LONG=$(curl --silent "https://api.github.com/repos/SAP/devops-docker-cf-cli/releases" | jq -r '.[].tag_name' | head -n1)
16+ echo Current version: $CURRENT_VERSION_LONG
17+ CURRENT_VERSION=`echo $CURRENT_VERSION_LONG | cut -c 2- | cut -d. -f1`
18+ NEXT_VERSION=v$(expr $CURRENT_VERSION + 1)
19+ echo Next version: $NEXT_VERSION
20+ STATUS_CODE_FOR_NEXT_RELEASE=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/SAP/devops-docker-cf-cli/releases/tags/$NEXT_VERSION")
21+ if [ "$STATUS_CODE_FOR_NEXT_RELEASE" != "404" ]; then
22+ echo "Planned next release version ($NEXT_VERSION) already exists, aborting process"
23+ exit 1
24+ fi
25+ echo "::set-env name=PIPER_version::$NEXT_VERSION"
26+ - name : Build, test and push
27+ run : |
28+ echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
29+ docker build -t ppiper/cf-cli:${{ env.PIPER_version }} .
30+ docker push ppiper/cf-cli:${{ env.PIPER_version }}
31+ - uses : SAP/project-piper-action@master
32+ with :
33+ piper-version : latest
34+ command : githubPublishRelease
35+ flags : --token ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments