Compare commits
61 Commits
7473910598
...
testing-ci
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd1b3accb4 | ||
|
|
7968ceed33 | ||
|
|
54ffd24610 | ||
|
|
ad55d7018d | ||
|
|
c696efbac3 | ||
|
|
e2eeafacc8 | ||
|
|
604633fe7f | ||
|
|
00da78dd87 | ||
|
|
bea4784dc6 | ||
|
|
ce09964bc1 | ||
|
|
374909497a | ||
|
|
1e1f25f3ff | ||
|
|
d05ba9903c | ||
|
|
4f49fcfa48 | ||
|
|
e86e7287be | ||
|
|
5fb92608d2 | ||
|
|
37cd25db56 | ||
|
|
6284facd45 | ||
|
|
0ebdeb5cc2 | ||
|
|
4f7a7c7445 | ||
|
|
ab3f36ee41 | ||
|
|
ab9876b81a | ||
|
|
da76380ec1 | ||
|
|
be2aec45d7 | ||
|
|
766484a12a | ||
|
|
daacb9ad9b | ||
|
|
37d848325b | ||
|
|
597e2bc127 | ||
|
|
8c243d2ebe | ||
|
|
0af26607ec | ||
|
|
93adb089f4 | ||
|
|
eb24f84935 | ||
|
|
450fc18b1a | ||
|
|
576abba4b0 | ||
|
|
2150568632 | ||
|
|
bd57b3e5c7 | ||
|
|
28751fb1d3 | ||
|
|
04769dc468 | ||
|
|
1b1d2dfa23 | ||
|
|
c18e477dfc | ||
|
|
9283322dbb | ||
|
|
669b1ca240 | ||
|
|
55fef92fa9 | ||
|
|
dedebb2c36 | ||
|
|
70c1381e1d | ||
|
|
5a09cb629d | ||
|
|
5d0329d6c5 | ||
|
|
d0ae75c973 | ||
|
|
22d1473f29 | ||
|
|
178b7e3419 | ||
|
|
6ccc0f4f3f | ||
|
|
95504cb8b9 | ||
|
|
e626cc9b76 | ||
|
|
a283e63404 | ||
|
|
3e2fcc2e09 | ||
|
|
22baf098f2 | ||
|
|
dd5db92bea | ||
|
|
ee517d6aca | ||
|
|
9191c0d50a | ||
|
|
c6403415f4 | ||
|
|
e00b2b2d33 |
@@ -1,19 +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: arch-test
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
- name: Login to container registry
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
uses: https://github.com/docker/login-action@v3
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
with:
|
||||||
|
registry: https://git.vanespen.dev
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
password: ${{ secrets.PASSWORD }}
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
- name: Set up Docker Buildx
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
- name: List files in the repository
|
- name: Build and push
|
||||||
|
uses: https://github.com/docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
pull: true
|
||||||
|
no-cache: true
|
||||||
|
tags: "git.vanespen.dev/evanespen/blog:latest"
|
||||||
|
- name: Setup Kubectl
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
mkdir ~/.kube
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config
|
||||||
|
export COMMIT_REF=$(git rev-parse HEAD)
|
||||||
|
echo $COMMIT_REF
|
||||||
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
|
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
|
||||||
|
|||||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM archlinux as builder
|
||||||
|
|
||||||
|
RUN pacman -Syy \
|
||||||
|
&& pacman -S --noconfirm go dart-sass icu
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN go run .
|
||||||
|
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
RUN rm -rf /usr/share/nginx/html/
|
||||||
|
|
||||||
|
COPY --from=builder /app/build/ /usr/share/nginx/html/
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
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
|
||||||
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
|
||||||
Reference in New Issue
Block a user