Skip to content

Commit

Permalink
[skip ci] Deploy from chat and let argocd update status
Browse files Browse the repository at this point in the history
  • Loading branch information
oscrx committed Aug 7, 2023
1 parent 13f1564 commit 7fef7b0
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/issue-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: branch-deploy

on:
issue_comment:
types: [created]

# Permissions needed for reacting and adding comments for IssueOps commands
permissions:
pull-requests: write
deployments: write
contents: write
checks: read

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request }} # only run on pull request comments

steps:
# The branch-deploy Action
- name: branch-deploy
id: branch-deploy
uses: github/[email protected]

# If the branch-deploy Action was triggered, checkout our branch
- uses: actions/checkout@v3
with:
ref: ${{ steps.branch-deploy.outputs.ref }}

# If the branch-deploy Action was triggered, run the deployment (i.e. '.deploy')
- name: deploy
if: ${{ steps.branch-deploy.outputs.continue == 'true' && steps.branch-deploy.outputs.noop != 'true' }}
run: echo ${{ steps.branch-deploy.outputs.ref }}
17 changes: 17 additions & 0 deletions .github/workflows/workflow-dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

name: Repository Dispatch
on:
repository_dispatch:
types: [argocd]

# permissions:
# pull-requests: write
# deployments: write
# contents: write
# checks: read

jobs:
deployment-started:
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.event.client_payload }}
57 changes: 57 additions & 0 deletions charts/drinkn/templates/github-webhooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{{- if .Values.pr.enabled }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: sync-hook
annotations:
argocd.argoproj.io/hook: Sync
# argocd.argoproj.io/hook: PostSync
spec:
template:
spec:
containers:
- name: curl
image: curlimages/curl:latest
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: github-token
key: token
command:
- "curl"
args:
- -L
- -XPOST
- -H
- "Accept: application/vnd.github+json"
- -H
- "Authorization: Bearer $GITHUB_TOKEN"
- -H
- "X-GitHub-Api-Version: 2022-11-28"
- https://api.github.com/repos/bierteam/drinkn/dispatches
- -d
- |
{
"event_type": "argocd",
"client_payload": {
"passed": false,
"message": "Error: timeout"
}
}
restartPolicy: Never
backoffLimit: 0
---
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
argocd.argoproj.io/hook: PreSync
sealedsecrets.bitnami.com/cluster-wide: "true"
a8r.io/description: Expires on Wed, Aug 7 2024. https://github.com/settings/tokens?type=beta
name: github-token
spec:
encryptedData:
token: AgASRow85Bv/IGZTftJ5BdtnqMejgyJMNiU7z5fwJkVYZFQoc5RTYchVK5a5y4tLpT256waDcOncWavGgTsXybNo5uPUukUNE21NsCiq/Po9RtG/NYmVmJ0VeNJSVES5JYB0MPU9SsKBli1mAUWQW7gP+cVeTZCyu5Ii9SGoKOxPRMNl+8U58WAy1pYfWNimU6WA2S83VXV9IUYOqGwKfiI4Jx7na0BihiZBbMnDWXIXM+aJQ4YJoZBJ0/TtsKABJK/ictxRSdzxjzDKNTgvTBX4Vh5Nx6lTkB2++5MHqjKF+/LnuL/KawVTZhJOVw7GRxr7AW6Wuyph3l2RENwBx27IKbrPZsdKWnmS4CswpwYh0jp0pnIrs8fgPGMu+/EPP+B+Xnvd3EkLsllXQBpXKFTswF5lzQPifj+oTwi6/6m91RgsnL9hCTHlt6tEuuwB6ge9CpiRpkc0Pqki/m0JhRjR+SNbv2XhlHaXRCMnzlnbc0cyVLwM73f6/UQ7A7eyIQ3EqFwuE1x76982gi9vFAMwqUWlgIlKBe9rt+mpvBXaawvkveCTnoaJ7VgncDnl/FlmDwFGmpX6locIBNvBL3xHSC5eKZ8t6ZyfhhkEXgDPw8GA8RHX9Sute6DAXrVux+lbQ4WphEcYWwPASx0KSLz2J2pxck6OdfQERQ0zekLWF/z1lBy6aMCgMMi24bEpIE2YKCuSHk33/oRQn32LRTIsiqnPsrQk071EMOVrcgPybFsjScFpOpx9YAN9ba58glBwuohXktAbdZ24ro3wZa1K1aqWZZ2/NqwSszg8PmZxX7mSRXFkqwHV3IRZpB4=
{{- end }}
1 change: 0 additions & 1 deletion charts/drinkn/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ fqdn: pils.oscarr.nl
pr:
enabled: false
number: 9999

0 comments on commit 7fef7b0

Please sign in to comment.