-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 1.93 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'
jobs:
release:
runs-on: 'ubuntu-latest'
steps:
# Setup
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
# Check Versions
- name: Check If Versions Match
run: |
helm_version=$(sed -n '/^version: / s/version: *// p' "charts/helmfile-cd/Chart.yaml")
helm_appversion=$(sed -n '/^appVersion: / s/appVersion: *// p' "charts/helmfile-cd/Chart.yaml" | tr -d "\"'")
set -x
test "${helm_version}" = "${GITHUB_REF_NAME#v}"
test "${helm_appversion}" = "${GITHUB_REF_NAME}"
# Upload Docker Image
- name: Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
withlazers/helmfile-cd
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: withlazers
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
# Release Helm Chart
- uses: withlazers/copy-to-repo-action@main
with:
ssh_key: ${{ secrets.HELMCHART_SSH_DEPLOY_KEY }}
source_path: ./charts/helmfile-cd
target_repository: withlazers/charts-withlazers
target_path: ./charts/helmfile-cd
commit_message: |
automatic pipeline release of helmfile-cd ${{ github.ref_name }}
Source: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
- uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: true