-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (42 loc) · 1.56 KB
/
dockerpush.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
name: Build and Publish Docker
on:
push:
tags:
- 'v*.*.*' ## will be the tag of docker image
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish Server to Github Registry
uses: docker/build-push-action@v3
with:
repository: aau-network-security/haaukins-store/server
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
tag_with_ref: true
tag_with_sha: true
- name: Publish server to dockerhub
uses: docker/build-push-action@v3
with:
repository: aaunetworksecurity/haaukins-store
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_H_PASSWORD }}
tag_with_ref: true
tag_with_sha: true
- name: prev_tag
run: echo "::set-output name=prevtag::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
- name: current_tag
run: echo "::set-output name=currenttag::$(git describe --tags --abbrev=0)"
- name: Create Change Log
run: |
git --no-pager log --pretty=oneline ${{ steps.prev_tag.outputs.prevtag }}...${{ steps.current_tag.outputs.currenttag }} > changelog.txt
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1.10.0
with:
tag: ${{ github.ref }}
name: Release ${{ github.ref }}
bodyFile: ./changelog.txt
token: ${{ secrets.GITHUB_TOKEN }}