-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (88 loc) · 2.96 KB
/
publish.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
name: publish
on:
push:
tags:
- "*"
branches:
- "*"
env:
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
jobs:
build:
name: Build Container Image
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/[email protected]
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: image_name_generator
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_NAME }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }}
- name: Build and push Docker image
id: build-and-push-release
uses: docker/[email protected]
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: |
${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }}:latest
${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }}:${{ github.ref_name }}
deploy:
name: Deploy to parminpaas.ir
needs: build
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: tale/kubectl-action@v1
with:
base64-kube-config: ${{ secrets.KUBE_CONFIG }}
- uses: helmwave/[email protected]
name: Install helmwave
with:
version: "0.36.3"
- name: Templating helmwave.yml.tpl
working-directory: "./deployments/kubernetes"
run: "helmwave yml"
env:
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }}
DOMAIN: ${{ secrets.DOMAIN }}
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }}
VERSION: ${{ github.ref_name }}
- name: Plan
working-directory: "./deployments/kubernetes"
run: helmwave build
env:
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }}
DOMAIN: ${{ secrets.DOMAIN }}
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }}
VERSION: ${{ github.ref_name }}
- name: Deploy
working-directory: "./deployments/kubernetes"
run: helmwave up --kubedog --progress
env:
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }}
DOMAIN: ${{ secrets.DOMAIN }}
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }}
VERSION: ${{ github.ref_name }}