ci(#3): 🔒 Added registry login

This commit is contained in:
Daniel Sy 2025-03-28 12:47:59 +01:00
parent ddbf2e01eb
commit 721cc90331
Signed by: Daniel.Sy
GPG key ID: 1F39A8BBCD2EE3D3

View file

@ -19,14 +19,15 @@ jobs:
docker build -t loic:${{ github.sha }} . docker build -t loic:${{ github.sha }} .
echo "$FORGEJO_API_TOKEN" | docker login -u {{ .Identity }} --password-stdin ${{ env.FORGEJO_BASE_URL }} echo "$FORGEJO_API_TOKEN" | docker login -u {{ .Identity }} --password-stdin ${{ env.FORGEJO_BASE_URL }}
docker tag loic:${{ github.sha }} ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/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 }} docker push ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }}
- name: Update Deployment Manifest # - name: Update Deployment Manifest
run: | # run: |
sed -i "s|image: .*|image: ${{ env.FORGEJO_BASE_URL }}/{{ .Identity }}/loic:${{ github.sha }}|" k8s/deployment.yaml # 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.email "ci@edp.local"
git config --global user.name "CI Bot" # git config --global user.name "CI Bot"
git add k8s/deployment.yaml # git add k8s/deployment.yaml
git commit -m "Update image to ${{ github.sha }}" # git commit -m "Update image to ${{ github.sha }}"
git push # git push
env: env:
FORGEJO_API_TOKEN: ${{ secrets.FORGEJO_API_TOKEN }} FORGEJO_API_TOKEN: ${{ secrets.FORGEJO_API_TOKEN }}