Compare commits
10 commits
c94fce57ae
...
71b6810ae7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
71b6810ae7 | ||
![]() |
721cc90331 | ||
![]() |
ddbf2e01eb | ||
![]() |
eb07c2786a | ||
![]() |
f535f4344e | ||
![]() |
21a70013f4 | ||
![]() |
5679d19b3f | ||
![]() |
658a6b37d6 | ||
![]() |
1e7c309700 | ||
![]() |
7ad596127d |
1 changed files with 33 additions and 0 deletions
33
.forgejo/workflows/pipeline.yml
Normal file
33
.forgejo/workflows/pipeline.yml
Normal 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 }}
|
Loading…
Reference in a new issue