-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (55 loc) · 1.88 KB
/
publish.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
name: publish
on:
push:
tags:
- "f2s-*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Repo Owner
id: get_repo_owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" > $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get TAG
id: get_tag
run: echo TAG=${GITHUB_REF#refs/tags/} | sed 's/f2s-//' >> $GITHUB_ENV
- name: Generate new Release
run: |
python3 -m pip install -r ./utility/requirements.txt
python3 ./utility/create_release.py ${{ env.TAG }}
- name: Commit Helm Chart Archive and Tag
run: |
git config --local user.email "[email protected]"
git config --local user.name ${{ env.REPO_OWNER }}
git branch helm-release-${{ env.TAG }}
git checkout helm-release-${{ env.TAG }}
git add ./helm-release/*.tgz
git add ./helm-release/index.yaml
git add ./helm/Chart.yaml
git commit -m "Add Helm chart archive ${{ env.TAG }}"
git push origin helm-release-${{ env.TAG }} --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
build-args: |
GIT_COMMIT=${{ github.sha }}
tags: |
romanhuesler/f2s:${{ github.sha }}
romanhuesler/f2s:${{ env.TAG }}
romanhuesler/f2s:latest