-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.89 KB
/
update-image.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
name: 'Update images'
on: [push]
jobs:
bump_version:
runs-on: ubuntu-latest
outputs:
tag: ${{steps.tag_version.outputs.new_tag}}
is_release: ${{steps.tag_version.outputs.is_release}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '1'
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Bump version and push tag
id: tag_version
uses: mhl787156/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
RELEASE_BRANCHES: master,main
DEFAULT_BUMP: patch
DEFAULT_PRERELEASE_BUMP: none
DRY_RUN: true # Dont push new tag here, only push on successful build
PRERELEASE_SUFFIX: ${{ steps.extract_branch.outputs.branch }}
bake_images:
runs-on: ubuntu-latest
needs: bump_version
strategy:
matrix:
targets: [starling-simple-offboard]
steps:
- name: Build Image
uses: mhl787156/starling-bake-build-action@main
with:
bakefile: ./buildtools/docker-bake.hcl
target: ${{ matrix.targets }}
tag: ${{ needs.bump_version.outputs.tag }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_TOKEN }}
build_arm64: true
release_version:
needs: [bump_version, bake_images]
runs-on: ubuntu-latest
steps:
- name: Create a GitHub release
uses: ncipollo/release-action@v1
if: |
!failure() && !cancelled() && success() &&
needs.bump_version.outputs.is_release == 'true'
with:
tag: ${{ needs.bump_version.outputs.tag }}
name: Release ${{ needs.bump_version.outputs.tag }}
allowUpdates: true