-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (40 loc) · 1.26 KB
/
release.yml
File metadata and controls
45 lines (40 loc) · 1.26 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
name: Release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git fetch
- name: Create git tag
run: git tag -a $(cat version) -m "Release new version $(cat version)"
- name: Set version env
run: echo "VERSION=$(cat version)" >> $GITHUB_ENV
- name: Build the Docker image
run: docker build -t koloooo/monhttp:$(cat version) -t koloooo/monhttp:latest .
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: koloooo/monhttp
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,${{ env.VERSION }}"
- name: Push tag
run: git push origin --tags
- name: Checkout develop
run: git checkout develop
- name: Increment version
run: ./increment_version.sh -m $(cat version) > version
- name: Add changes
run: git add version
- name: Commit changes
run: git commit -m "Update to version $(cat version)"
- name: Push changes
run: git push origin develop