From 5039fe2a21294b522fbbeeaf824f6f65f441669a Mon Sep 17 00:00:00 2001 From: DrunkBatya Date: Thu, 29 Feb 2024 17:43:37 +0300 Subject: [PATCH 1/3] Add separate dev layer deploy --- .github/workflows/deploy.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a2fc0a4..cc1b167 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -52,7 +52,17 @@ jobs: run: | echo ${{ steps.docker_build.outputs.digest }} - - name: 'Trigger k8s to use new image' + - name: 'Trigger k8s to use new dev image' + if: ${{ steps.tag.outputs.image_tag == '0.0.0' }} + uses: peter-evans/repository-dispatch@v2 + with: + repository: ${{ secrets.INFRASTRUCTURE_REPO_DEV }} + token: ${{ secrets.K8S_GITHUB_PAT }} + event-type: flpr-app-deploy + client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' + + - name: 'Trigger k8s to use new prod image' + if: ${{ steps.tag.outputs.image_tag != '0.0.0' }} uses: peter-evans/repository-dispatch@v2 with: repository: ${{ secrets.INFRASTRUCTURE_REPO }} From f22e2d823a419994d579eda325abdaed72b98f60 Mon Sep 17 00:00:00 2001 From: nikatar Date: Thu, 29 Feb 2024 19:24:00 +0100 Subject: [PATCH 2/3] test p-l chain --- .github/workflows/deploy.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc1b167..2b502ca 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,22 +1,23 @@ -name: 'Deploy' +name: "Deploy" on: push: branches: - dev + - drunkbatya/separate_dev_layer tags: - - '*' + - "*" jobs: build: runs-on: ubuntu-latest steps: - - name: 'Checkout code' + - name: "Checkout code" uses: actions/checkout@v3 with: fetch-depth: 0 - - name: 'Set image tag' + - name: "Set image tag" id: tag run: | IMAGE_TAG="0.0.0" @@ -28,31 +29,31 @@ jobs: echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT - - name: 'Set up QEMU' + - name: "Set up QEMU" uses: docker/setup-qemu-action@v2 - - name: 'Set up Docker Buildx' + - name: "Set up Docker Buildx" uses: docker/setup-buildx-action@v2 - - name: 'Login to GHCR' + - name: "Login to GHCR" uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - name: 'Build and push' + - name: "Build and push" id: docker_build uses: docker/build-push-action@v4 with: push: true tags: ghcr.io/flipperdevices/flpr.app:${{steps.tag.outputs.image_tag}} - - name: 'Image digest' + - name: "Image digest" run: | echo ${{ steps.docker_build.outputs.digest }} - - name: 'Trigger k8s to use new dev image' + - name: "Trigger k8s to use new dev image" if: ${{ steps.tag.outputs.image_tag == '0.0.0' }} uses: peter-evans/repository-dispatch@v2 with: @@ -61,7 +62,7 @@ jobs: event-type: flpr-app-deploy client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' - - name: 'Trigger k8s to use new prod image' + - name: "Trigger k8s to use new prod image" if: ${{ steps.tag.outputs.image_tag != '0.0.0' }} uses: peter-evans/repository-dispatch@v2 with: From 63c95c1f83bae5489b72dee50f6bf4f577b6c5ee Mon Sep 17 00:00:00 2001 From: nikatar Date: Thu, 29 Feb 2024 19:31:38 +0100 Subject: [PATCH 3/3] return old pl --- .github/workflows/deploy.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2b502ca..2b394f3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -53,17 +53,25 @@ jobs: run: | echo ${{ steps.docker_build.outputs.digest }} - - name: "Trigger k8s to use new dev image" - if: ${{ steps.tag.outputs.image_tag == '0.0.0' }} - uses: peter-evans/repository-dispatch@v2 - with: - repository: ${{ secrets.INFRASTRUCTURE_REPO_DEV }} - token: ${{ secrets.K8S_GITHUB_PAT }} - event-type: flpr-app-deploy - client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' + # - name: "Trigger k8s to use new dev image" + # if: ${{ steps.tag.outputs.image_tag == '0.0.0' }} + # uses: peter-evans/repository-dispatch@v2 + # with: + # repository: ${{ secrets.INFRASTRUCTURE_REPO_DEV }} + # token: ${{ secrets.K8S_GITHUB_PAT }} + # event-type: flpr-app-deploy + # client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' + # + # - name: "Trigger k8s to use new prod image" + # if: ${{ steps.tag.outputs.image_tag != '0.0.0' }} + # uses: peter-evans/repository-dispatch@v2 + # with: + # repository: ${{ secrets.INFRASTRUCTURE_REPO }} + # token: ${{ secrets.K8S_GITHUB_PAT }} + # event-type: flpr-app-deploy + # client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' - - name: "Trigger k8s to use new prod image" - if: ${{ steps.tag.outputs.image_tag != '0.0.0' }} + - name: "Trigger k8s to use new image" uses: peter-evans/repository-dispatch@v2 with: repository: ${{ secrets.INFRASTRUCTURE_REPO }}