Skip to content

Commit

Permalink
Update cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JuribaDev committed Aug 29, 2024
1 parent d402ebd commit 816fc1a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,16 @@ jobs:
echo "cert-manager is already installed."
fi
sudo chmod 777 k8s/cluster-issuer.yaml
# Create ClusterIssuer if it doesn't exist
if ! kubectl get clusterissuer letsencrypt-prod &> /dev/null; then
cat<<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: ${{ secrets.LETSENCRYPT_EMAIL }}
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx
EOF
sed -i "s|LETSENCRYPT_EMAIL_PLACEHOLDER|${{ secrets.LETSENCRYPT_EMAIL }}|g" k8s/cluster-issuer.yaml
kubectl apply -f k8s/cluster-issuer.yaml
echo "ClusterIssuer created."
else
echo "ClusterIssuer already exists."
fi
echo "ClusterIssuer created."
else
echo "ClusterIssuer already exists."
Expand Down
14 changes: 14 additions & 0 deletions k8s/cluster-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: LETSENCRYPT_EMAIL_PLACEHOLDER
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx

0 comments on commit 816fc1a

Please sign in to comment.