-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.24 KB
/
build_web.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build web
on:
workflow_call:
env:
REGISTRY: ghcr.io
IMAGE_NAME: glaciation-heu/kg_exporter
jobs:
build_web:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install poetry
run: pip install poetry
- name: Install Helm
uses: azure/setup-helm@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64, linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Make versions
run: |
chmod +x ./tools/version.sh
./tools/version.sh "${{ github.sha }}" "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
echo "APP_VERSION=$(cat "./VERSION")" >> $GITHUB_ENV
echo "DOCKER_IMAGES=$(cat "./DOCKER_IMAGES")" >> $GITHUB_ENV
echo "DOCKER_TAGS=$(cat "./VERSION_DOCKER")" >> $GITHUB_ENV
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ env.DOCKER_TAGS }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.DOCKER_IMAGES }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install --no-root --with dev
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Create a github release
run: gh release create "${{ env.APP_VERSION }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ github.token }}
target_dir: "./helm-charts/"