Breaking out merge and trigger into separate jobs (testing trigger).

This commit is contained in:
2025-01-14 10:14:52 -05:00
parent 4fe91d095c
commit 2dbe6b7a3b
+32 -32
View File
@@ -159,14 +159,13 @@ jobs:
message: "chore: Update README"
add: "README.md"
trigger-and-merge:
name: Trigger Deployment
needs: [generate-readme, docker-compose-test, regenerate-readme]
manual-trigger-deploy:
name: Manual Trigger
needs: [docker-compose-test, cloudflare-dns-setup, regenerate-readme]
outputs:
CONTINUE_JOBS: ${{ steps.manual-trigger.outputs.CONTINUE_JOBS }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gotify Notification
uses: eikendev/gotify-action@master
with:
@@ -175,42 +174,43 @@ jobs:
notification_title: 'Ready to Deploy'
notification_message: 'Ready to deploy: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'
- name: manual-trigger
- name: Manual Trigger
uses: benhamiltonpro/manual-trigger@v1.0.2
id: manual-trigger
uses: trstringer/manual-approval@v1.9.1
with:
secret: ${{ secrets.BOT_GITEA_TOKEN }}
approvers: Trez.One
minimum-approvals: 1
issue-title: "Deploying ${{ github.ref_name }} (PR #{{ steps.pr_merge.outputs.pr_index }})"
issue-body: "Testing for now"
exclude-workflow-initiator-as-approver: false
additional-approved-words: ''
additional-denied-words: ''
RUN_NAME: "pr-merge"
# - name: PR Merge
# id: pr_merge
# run: |
# tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
# tea login default gitea-rinoa
# pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g')
# tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR #${pr_index} - ${{ gitea.ref_name }}" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index}
# echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT
pr-merge:
name: Trigger Deployment
if: ${{ needs.manual-trigger-deploy.outputs.CONTINUE_JOBS == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Wait for PR to be merged
# run: |
# while true; do
# pr_state=$(tea pr ls --repo ${{ github.repository }} --state merged --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F, '{print $4}' | sed -e 's|"||g')
# if [ "${pr_state}" == "merged" ]; then
# break
# - name: PR Merge
# id: pr_merge
# run: |
# tea login add --name gitea-rinoa --url ${{ secrets.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
# tea login default gitea-rinoa
# pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ gitea.ref_name }} | awk -F, '{print $1}' | sed -e 's|"||g')
# tea pr m --repo ${{ github.repository }} --title "Auto Merge of PR #${pr_index} - ${{ gitea.ref_name }}" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index}
# echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT
# - name: Wait for PR to be merged
# run: |
# while true; do
# pr_state=$(tea pr ls --repo ${{ github.repository }} --state merged --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F, '{print $4}' | sed -e 's|"||g')
# if [ "${pr_state}" == "merged" ]; then
# break
# docker-compose-deploy:
# name: Deploy via Docker Compose
# runs-on: ubuntu-latest
# needs: [merge-and-trigger]
# needs: [pr-merge]
# env:
# VAULT_ADDR: ${{ secrets.RINOA_VAULT_ADDR }}
# VAULT_TOKEN: ${{ secrets.RINOA_VAULT_TOKEN }}
# VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
# DOCKER_HOST: tcp://dockerproxy:2375
# environment: approval-environment
# steps: