Compare commits

..

10 commits

Author SHA1 Message Date
Daniel Sy
71b6810ae7
ci(#3): 💄 Fix registry login
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m18s
2025-03-28 12:52:17 +01:00
Daniel Sy
721cc90331
ci(#3): 🔒 Added registry login 2025-03-28 12:47:59 +01:00
Daniel Sy
ddbf2e01eb
ci(#3): 🍱 Update go version 2025-03-28 12:45:10 +01:00
Daniel Sy
eb07c2786a
ci(#3): ⬇️ Download go dependencies 2025-03-28 12:43:30 +01:00
Daniel Sy
f535f4344e
fix(#3): 🔥 Remove github actions 2025-03-28 12:41:45 +01:00
Daniel Sy
21a70013f4
fix(#3): ⚗️ Add github url 2025-03-28 12:28:12 +01:00
Daniel Sy
5679d19b3f
ci(#3): 🐛 Try http action from github 2025-03-28 12:26:26 +01:00
Daniel Sy
658a6b37d6
fix(#3): 👷 Use correct runner 2025-03-28 12:19:00 +01:00
Daniel Sy
1e7c309700
fix(#3): 🐛 Run pipeline on feature branch 2025-03-28 12:07:45 +01:00
Daniel Sy
7ad596127d
ci(#3): ⚗️ Setup pipeline 2025-03-28 12:04:34 +01:00

View file

@ -0,0 +1,33 @@
name: CI/CD Pipeline
on: push
env:
FORGEJO_BASE_URL: ${{ vars.FORGEJO_BASE_URL }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.24'
- name: Build Go Binary
run: go mod tidy && go build -o loic
- name: Build and Push Docker Image
run: |
docker build -t loic:${{ github.sha }} .
docker tag loic:${{ github.sha }} ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }}
docker login -u {{ .Identity }} --password-stdin ${{ secret.PASSWORD }}
docker push ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }}
# - name: Update Deployment Manifest
# run: |
# sed -i "s|image: .*|image: ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }}|" k8s/deployment.yaml
# git config --global user.email "ci@edp.local"
# git config --global user.name "CI Bot"
# git add k8s/deployment.yaml
# git commit -m "Update image to ${{ github.sha }}"
# git push
env:
FORGEJO_API_TOKEN: ${{ secrets.FORGEJO_API_TOKEN }}