-
Notifications
You must be signed in to change notification settings - Fork 11
72 lines (61 loc) · 2.2 KB
/
release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Release
on:
pull_request_target:
types: [closed]
workflow_dispatch:
inputs:
releaseType:
description: 'Release type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release_job:
uses: bedita/github-workflows/.github/workflows/release.yml@v1
with:
main_branch: 'master'
dist_branches: '["master", "3.x"]'
version_bump: ${{ inputs.releaseType }}
version_ini_path: config/version.ini
version_ini_prefix: "[Manager]\nversion="
package_json_version: true
docker_push:
runs-on: 'ubuntu-latest'
needs: release_job
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Debug output version
run: |
echo version var ${{ needs.release_job.outputs.version }}
- name: Print message if no semantic version was created
if: contains(needs.release_job.outputs.version, 'undefined')
run: |
echo Skip version file update and docker image creation
- name: Update version file
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }}
run: |
echo -e "[Manager]\nversion = ${{ needs.release_job.outputs.version }}" > config/version.ini
- name: Set up QEMU
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }}
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }}
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ !contains(needs.release_job.outputs.version, 'undefined') }}
with:
context: .
push: true
tags: "${{ github.repository }}:${{ needs.release_job.outputs.version }},${{ github.repository }}:${{ needs.release_job.outputs.major }}"