-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.88 KB
/
release_deploy.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
name: Release
# Controls when the workflow will run
on:
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
packages: write
contents: write
issues: write
id-token: write
actions: read
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
- name: Get version
run: echo "version=$(cat ./version.txt)" >> $GITHUB_ENV
- name: Bump Version
id: bump_version
uses: pagopa/github-actions-template/bump-semver@main
with:
semver: 'minor'
current_version: ${{ env.version }}
- name: Push New Version
shell: bash
run: |
echo ${{ steps.bump_version.outputs.new_version }} > ./version.txt
git add .
git config --global user.email "github-bot@pagopa.it"
git config --global user.name "pagopa-github-bot"
git commit -m "Bump to version ${{ steps.bump_version.outputs.new_version }} [skip ci]" || exit 0
git push origin ${{ github.ref_name }}
- name: Create Release
uses: ncipollo/release-action@v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit: ${{ github.ref_name }}
tag: ${{ steps.bump_version.outputs.new_version }}
name: Release ${{ steps.bump_version.outputs.new_version }}
makeLatest: latest
generateReleaseNotes: true
- name: Build and Push
id: semver
uses: pagopa/github-actions-template/ghcr-build-push@v1.5.4
with:
tag: ${{ steps.bump_version.outputs.new_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}