From 87e1749d4910f9c3cd113b074b8cd3608d3c0507 Mon Sep 17 00:00:00 2001 From: lars Date: Wed, 4 Oct 2023 15:29:08 -0500 Subject: [PATCH] Add Gitea workflow --- .gitea/workflows/DeployPR.yaml | 22 ++++++++++++++++++++++ .gitea/workflows/UndeployPR.yaml | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .gitea/workflows/DeployPR.yaml create mode 100644 .gitea/workflows/UndeployPR.yaml diff --git a/.gitea/workflows/DeployPR.yaml b/.gitea/workflows/DeployPR.yaml new file mode 100644 index 0000000..cb86e24 --- /dev/null +++ b/.gitea/workflows/DeployPR.yaml @@ -0,0 +1,22 @@ +name: Deploy PR +run-name: ${{ gitea.actor }} is deploying a PR +on: + pull_request: + types: [ opened, reopened ] + +jobs: + Deploy PR: + runs-on: ubuntu-latest + container: + image: python + steps: + - pip3 install requests python-dotenv --quiet + - python3 deploy/portainer/deploy.py + --PORTAINER https://dvportainer.privatedns.org + --PORTAINER_API_KEY=ptr_RwxH2Cd+htdD2FoFiG46erT9beyvj9VoF3BrQPtDH3Q= + --PORTAINER_EP=CICD-runner + --GITEA_API_KEY=f449c74ec7f04e54fe1e481eae43492b34cea406 + --DEPLOY_REPO_URL=${DRONE_REPO_LINK} + --DEPLOY_BRANCH=${DRONE_SOURCE_BRANCH} + --DEPLOY_HOST=dvdemo.privatedns.org + \ No newline at end of file diff --git a/.gitea/workflows/UndeployPR.yaml b/.gitea/workflows/UndeployPR.yaml new file mode 100644 index 0000000..dfb109c --- /dev/null +++ b/.gitea/workflows/UndeployPR.yaml @@ -0,0 +1,21 @@ +name: Undeploy PR +run-name: ${{ gitea.actor }} is undeploying a PR +on: + pull_request: + types: [ closed ] + +jobs: + Deploy PR: + runs-on: ubuntu-latest + container: + image: python + steps: + - pip3 install requests python-dotenv --quiet + - python3 deploy/portainer/undeploy.py + --PORTAINER https://dvportainer.privatedns.org + --PORTAINER_API_KEY=ptr_RwxH2Cd+htdD2FoFiG46erT9beyvj9VoF3BrQPtDH3Q= + --PORTAINER_EP=CICD-runner + --GITEA_API_KEY=f449c74ec7f04e54fe1e481eae43492b34cea406 + --DEPLOY_REPO_URL=${DRONE_REPO_LINK} + --DEPLOY_BRANCH=${DRONE_SOURCE_BRANCH} + \ No newline at end of file