-
Notifications
You must be signed in to change notification settings - Fork 49
82 lines (81 loc) · 2.85 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
73
74
75
76
77
78
79
80
81
82
name: 'Release new version'
on: workflow_dispatch
jobs:
build-test:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'dockerfile-image-update-') == false
steps:
- name: checkout
uses: actions/checkout@main
with:
ref: ${{ github.ref }}
- name: docker build
run: make mvn-docker-build get-main-project-dirs
- name: Upload main module
uses: actions/upload-artifact@v1
with:
name: dockerfile-image-update
path: dockerfile-image-update
- name: Upload itest module
uses: actions/upload-artifact@v1
with:
name: dockerfile-image-update-itest
path: dockerfile-image-update-itest
get-next-version:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'dockerfile-image-update-') == false
outputs:
version: ${{ steps.version_tag.outputs.new_version }}
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: get version
id: version_tag
run: |
make get-new-version-from-tag
echo "new_version=$(cat new_patch_version.txt)" >> $GITHUB_OUTPUT
integration-test:
runs-on: ubuntu-latest
needs: [build-test, get-next-version]
steps:
- name: checkout
uses: actions/checkout@main
with:
ref: ${{ github.ref }}
- name: Download itest dir
uses: actions/download-artifact@v1
with:
name: dockerfile-image-update-itest
- name: integration test
env:
ITEST_GH_TOKEN: ${{ secrets.ITEST_GH_TOKEN }}
run: echo "Testing new version ${{ needs.get-next-version.outputs.version }}" && make integration-test
deploy:
needs: [ integration-test, get-next-version ]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: checkout
uses: actions/checkout@main
with:
ref: ${{ github.ref }}
- name: Download main project dir
uses: actions/download-artifact@v1
with:
name: dockerfile-image-update
- name: deploy
env:
encrypted_00fae8efff8c_iv: ${{ secrets.encrypted_00fae8efff8c_iv }}
encrypted_00fae8efff8c_key: ${{ secrets.encrypted_00fae8efff8c_key }}
encrypted_96e73e3cb232_iv: ${{ secrets.encrypted_96e73e3cb232_iv }}
encrypted_96e73e3cb232_key: ${{ secrets.encrypted_96e73e3cb232_key }}
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
CI_DEPLOY_USER: ${{ secrets.CI_DEPLOY_USER }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
NEW_PATCH_VERSION: ${{ needs.get-next-version.outputs.version }}
run: make deploy