dev #12
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: deploy | |
on: | |
deployment | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
deployment-id: ${{ github.event.deployment.id }} | |
description: Trigger the pipeline | |
state: "queued" | |
token: "${{ github.token }}" | |
- | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
deployment-id: ${{ github.event.deployment.id }} | |
description: Start to deploy to the Kubernetes | |
log-url: https://gitploy.jp.ngrok.io/applications/${{ github.event.deployment.payload.application }} | |
state: "in_progress" | |
token: "${{ github.token }}" | |
- | |
name: Log in | |
uses: clowdhaus/argo-cd-action/@main | |
with: | |
version: 2.3.3 | |
command: login gitploy.jp.ngrok.io | |
options: > | |
--username | |
admin | |
--password | |
${{ secrets.ARGOCD_PASSWORD }} | |
- | |
name: Set image tag | |
uses: clowdhaus/argo-cd-action/@main | |
with: | |
version: 2.3.3 | |
command: app set ${{ github.event.deployment.payload.application }} | |
options: > | |
--revision ${{ github.sha }} | |
--kustomize-image gitployio/argocd-demo=gitployio/argocd-demo:sha-${{ github.sha }} | |
- | |
name: Sync | |
uses: clowdhaus/argo-cd-action/@main | |
with: | |
version: 2.3.3 | |
command: app sync ${{ github.event.deployment.payload.application }} | |
options: --timeout 300 | |
- | |
name: Wait | |
uses: clowdhaus/argo-cd-action/@main | |
with: | |
version: 2.3.3 | |
command: app wait ${{ github.event.deployment.payload.application }} | |
options: > | |
--health | |
--timeout 600 | |
- | |
if: success() | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
deployment-id: ${{ github.event.deployment.id }} | |
description: Finish to deploy successfully. | |
log-url: https://gitploy.jp.ngrok.io/applications/${{ github.event.deployment.payload.application }} | |
state: "success" | |
token: "${{ github.token }}" | |
- | |
if: failure() | |
uses: chrnorm/deployment-status@releases/v2 | |
with: | |
deployment-id: ${{ github.event.deployment.id }} | |
description: Failed to deploy. | |
log-url: https://gitploy.jp.ngrok.io/applications/${{ github.event.deployment.payload.application }} | |
state: "failure" | |
token: "${{ github.token }}" |