Actualiser .gitea/workflows/ci-main.yml
This commit is contained in:
parent
2d63487737
commit
474c9bea6e
@ -1,24 +1,26 @@
|
|||||||
name: BuildAndPushImageOnHarborAndUpdateArgoCDConfig
|
name: Build And Push Image On Harbor And Update
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "develop" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: docker/login-action@v1
|
- uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: harbor.example.com
|
registry: registry.tips-of-mine.com
|
||||||
username: ${{ secrets.HARBOR_USERNAME }}
|
username: ${{ secrets.HARBOR_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: BuildAndPushImageOnHarbor
|
- name: BuildAndPushImageOnHarbor
|
||||||
run: |
|
run: |
|
||||||
docker build ./ -t harbor.example.com/chaturmail/chaturmail-backend:${{ github.run_number }}
|
docker build ./ -t registry.tips-of-mine.com/chaturmail/chaturmail-backend:${{ github.run_number }}
|
||||||
docker push harbor.example.com/chaturmail/chaturmail-backend:${{ github.run_number }}
|
docker push registry.tips-of-mine.com/chaturmail/chaturmail-backend:${{ github.run_number }}
|
||||||
|
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
run: |
|
run: |
|
||||||
@ -29,7 +31,7 @@ jobs:
|
|||||||
sudo chmod a+x /usr/local/bin/yq
|
sudo chmod a+x /usr/local/bin/yq
|
||||||
- name: Update YAML File
|
- name: Update YAML File
|
||||||
run: |
|
run: |
|
||||||
yq -i '.spec.template.spec.containers[0].image = "harbor.example.com/chaturmail/chaturmail-backend:${{ github.run_number }}"' 'argocd-configs/chaturmail-pod.yaml'
|
yq -i '.spec.template.spec.containers[0].image = "registry.tips-of-mine.com/chaturmail/chaturmail-backend:${{ github.run_number }}"' 'argocd-configs/chaturmail-pod.yaml'
|
||||||
|
|
||||||
- name: Push to Repo
|
- name: Push to Repo
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user