Compare commits
16 Commits
37cd25db56
...
testing-ci
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd1b3accb4 | ||
|
|
7968ceed33 | ||
|
|
54ffd24610 | ||
|
|
ad55d7018d | ||
|
|
c696efbac3 | ||
|
|
e2eeafacc8 | ||
|
|
604633fe7f | ||
|
|
00da78dd87 | ||
|
|
bea4784dc6 | ||
|
|
ce09964bc1 | ||
|
|
374909497a | ||
|
|
1e1f25f3ff | ||
|
|
d05ba9903c | ||
|
|
4f49fcfa48 | ||
|
|
e86e7287be | ||
|
|
5fb92608d2 |
@@ -1,35 +1,36 @@
|
|||||||
name: Gitea Actions Demo
|
name: Build and deploy
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
run-name: 🚀
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
Build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# - name: Login to container registry
|
- name: Login to container registry
|
||||||
# uses: https://github.com/docker/login-action@v3
|
uses: https://github.com/docker/login-action@v3
|
||||||
# with:
|
with:
|
||||||
# registry: https://git.vanespen.dev
|
registry: https://git.vanespen.dev
|
||||||
# username: ${{ secrets.USERNAME }}
|
username: ${{ secrets.USERNAME }}
|
||||||
# password: ${{ secrets.PASSWORD }}
|
password: ${{ secrets.PASSWORD }}
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# - name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
# uses: https://github.com/docker/setup-buildx-action@v3
|
uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
# - name: Build and push
|
- name: Build and push
|
||||||
# uses: https://github.com/docker/build-push-action@v6
|
uses: https://github.com/docker/build-push-action@v6
|
||||||
# with:
|
with:
|
||||||
# context: .
|
context: .
|
||||||
# push: true
|
push: true
|
||||||
# pull: true
|
pull: true
|
||||||
# no-cache: true
|
no-cache: true
|
||||||
# tags: "git.vanespen.dev/evanespen/blog:latest"
|
tags: "git.vanespen.dev/evanespen/blog:latest"
|
||||||
- name: Setup Kubectl
|
- name: Setup Kubectl
|
||||||
run: |
|
run: |
|
||||||
env
|
|
||||||
mkdir ~/.kube
|
mkdir ~/.kube
|
||||||
echo "$KUBECONFIG" > ~/.kube/config
|
echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config
|
||||||
cat ~/.kube/config
|
export COMMIT_REF=$(git rev-parse HEAD)
|
||||||
# curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
echo $COMMIT_REF
|
||||||
# install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
# /usr/local/bin/kubectl apply --validate=false -f argo.yaml
|
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||||
|
sed -i "s/COMMIT_REF/$COMMIT_REF/g" argo.template.yaml
|
||||||
|
/usr/local/bin/kubectl apply --validate=false -f argo.template.yaml
|
||||||
|
|||||||
43
argo.template.yaml
Normal file
43
argo.template.yaml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: AppProject
|
||||||
|
metadata:
|
||||||
|
name: blog
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
description: Project for the blog application
|
||||||
|
sourceRepos:
|
||||||
|
- https://git.vanespen.dev/evanespen/blog
|
||||||
|
destinations:
|
||||||
|
- namespace: blog
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
clusterResourceWhitelist:
|
||||||
|
- group: "*"
|
||||||
|
kind: "*"
|
||||||
|
namespaceResourceWhitelist:
|
||||||
|
- group: "*"
|
||||||
|
kind: "*"
|
||||||
|
syncWindows: []
|
||||||
|
roles: []
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: blog-argo
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: blog
|
||||||
|
source:
|
||||||
|
repoURL: "https://git.vanespen.dev/evanespen/blog"
|
||||||
|
targetRevision: COMMIT_REF
|
||||||
|
path: "k8s"
|
||||||
|
destination:
|
||||||
|
server: "https://kubernetes.default.svc"
|
||||||
|
namespace: blog
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
18
argo.yaml
18
argo.yaml
@@ -1,18 +0,0 @@
|
|||||||
apiVersion: argoproj.io/v1alpha1
|
|
||||||
kind: Application
|
|
||||||
metadata:
|
|
||||||
name: blog-argo
|
|
||||||
namespace: argocd
|
|
||||||
spec:
|
|
||||||
project: default
|
|
||||||
source:
|
|
||||||
repoURL: "https://git.vanespen.dev/evanespen/blog"
|
|
||||||
path: "k8s"
|
|
||||||
targetRevision: developer
|
|
||||||
destination:
|
|
||||||
server: "https://kubernetes.default.svc"
|
|
||||||
namespace: argocd
|
|
||||||
syncPolicy:
|
|
||||||
automated:
|
|
||||||
prune: true
|
|
||||||
selfHeal: true
|
|
||||||
47
k8s/deploy.yaml
Normal file
47
k8s/deploy.yaml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: blog-pod
|
||||||
|
namespace: blog
|
||||||
|
labels:
|
||||||
|
app: blog-pod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: blog-container
|
||||||
|
image: git.vanespen.dev/evanespen/blog:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: blog-service
|
||||||
|
namespace: blog
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: blog-pod
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
||||||
|
type: ClusterIP
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: blog-ingressroute
|
||||||
|
namespace: blog
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
routes:
|
||||||
|
- match: Host(`vanespen.dev`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: blog-service
|
||||||
|
port: 80
|
||||||
|
tls:
|
||||||
|
certResolver: letsencrypt_dns
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Pod
|
|
||||||
metadata:
|
|
||||||
name: blog-pod
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: blog-container
|
|
||||||
image: git.vanespen.dev/evanespen/blog:latest
|
|
||||||
ports:
|
|
||||||
- containerPort: 80
|
|
||||||
Reference in New Issue
Block a user