temp #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: VP CD | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Build with Maven | |
run: mvn -B package --file vp-api/pom.xml | |
- name: Login and push to container registry | |
run: | | |
echo ${{ secrets.REGISTRY_PASS }} | docker login registry.bastian-somon.fr -u ${{ secrets.REGISTRY_USER }} --password-stdin | |
docker build -t registry.bastian-somon.fr/vp-backend:latest vp-api | |
docker push registry.bastian-somon.fr/vp-backend:latest | |
build-client: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login and push to container registry | |
run: | | |
echo ${{ secrets.REGISTRY_PASS }} | docker login registry.bastian-somon.fr -u ${{ secrets.REGISTRY_USER }} --password-stdin | |
docker build -t registry.bastian-somon.fr/vp-frontend:latest vp-ui | |
docker push registry.bastian-somon.fr/vp-frontend:latest | |
deploy-infra-sandbox: | |
needs: [build-server, build-client] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Trigger deploy | |
uses: Consensys/kubernetes-action@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG }} | |
with: | |
args: apply -k infra/application/sandbox | |
deploy-infra-production: | |
needs: [deploy-infra-sandbox ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Trigger deploy | |
uses: Consensys/kubernetes-action@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG }} | |
with: | |
args: apply -k infra/application/production | |
rollout-infra: | |
needs: [deploy-infra-production] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Trigger backend rollout | |
uses: Consensys/kubernetes-action@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG }} | |
with: | |
args: rollout restart deployment spring -n vp | |
- name: Trigger frontend rollout | |
uses: Consensys/kubernetes-action@master | |
env: | |
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG }} | |
with: | |
args: rollout restart deployment nginx -n vp |