Switching from action to run for generating README.
This commit is contained in:
@@ -147,16 +147,11 @@ jobs:
|
||||
file: ./services.yml
|
||||
|
||||
- name: Regenerate README
|
||||
uses: gnpaone/dynamic-update-readme@v1.0.2
|
||||
with:
|
||||
table: true
|
||||
commit_user: markdown-update-bot
|
||||
commit_email: bot@github.com
|
||||
commit_message: "chore: Update README"
|
||||
marker_text: "SERVICES_LIST"
|
||||
markdown_text: |
|
||||
${{ steps.service-table.outputs.table }}
|
||||
confirm_and_push: false
|
||||
run: |
|
||||
echo "# List of Services" > README.md
|
||||
echo "___________________________________________" >> README.md
|
||||
echo -e "\n\n" >> README.md
|
||||
echo "${{ steps.service-table.outputs.table }}" >> README.md
|
||||
|
||||
- name: Add/Commit README.md
|
||||
id: commit-readme
|
||||
@@ -165,77 +160,77 @@ jobs:
|
||||
message: "chore: Update README"
|
||||
add: "README.md"
|
||||
|
||||
merge-and-trigger:
|
||||
name: Merge PR & Trigger Deployment
|
||||
if: ${{ regenerate-readme.outputs.pr-pushed == 'true' }}
|
||||
needs: [generate-readme, docker-compose-test, regenerate-readme]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
# merge-and-trigger:
|
||||
# name: Merge PR & Trigger Deployment
|
||||
# if: ${{ regenerate-readme.outputs.pr-pushed == 'true' }}
|
||||
# needs: [generate-readme, docker-compose-test, regenerate-readme]
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
|
||||
- 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: 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
|
||||
# - 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: Gotify Notification
|
||||
uses: eikendev/gotify-action@master
|
||||
with:
|
||||
gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
||||
gotify_app_token: '${{ secrets.RINOA_GOTIFY_TOKEN }}'
|
||||
notification_title: 'Ready to Deploy'
|
||||
notification_message: 'Ready to deploy: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'
|
||||
# - name: Gotify Notification
|
||||
# uses: eikendev/gotify-action@master
|
||||
# with:
|
||||
# gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
||||
# gotify_app_token: '${{ secrets.RINOA_GOTIFY_TOKEN }}'
|
||||
# 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
|
||||
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: ''
|
||||
# - name: manual-trigger
|
||||
# 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: ''
|
||||
|
||||
docker-compose-deploy:
|
||||
name: Deploy via Docker Compose
|
||||
runs-on: ubuntu-latest
|
||||
needs: [merge-and-trigger]
|
||||
env:
|
||||
VAULT_ADDR: ${{ secrets.RINOA_VAULT_ADDR }}
|
||||
VAULT_TOKEN: ${{ secrets.RINOA_VAULT_TOKEN }}
|
||||
DOCKER_HOST: tcp://dockerproxy:2375
|
||||
environment: approval-environment
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
# docker-compose-deploy:
|
||||
# name: Deploy via Docker Compose
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [merge-and-trigger]
|
||||
# env:
|
||||
# VAULT_ADDR: ${{ secrets.RINOA_VAULT_ADDR }}
|
||||
# VAULT_TOKEN: ${{ secrets.RINOA_VAULT_TOKEN }}
|
||||
# DOCKER_HOST: tcp://dockerproxy:2375
|
||||
# environment: approval-environment
|
||||
# steps:
|
||||
# - name: Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# ref: main
|
||||
|
||||
- name: Install Vault
|
||||
uses: cpanato/vault-installer@main
|
||||
# - name: Install Vault
|
||||
# uses: cpanato/vault-installer@main
|
||||
|
||||
- name: Generate .env file for deployment
|
||||
run: |
|
||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||
# - name: Generate .env file for deployment
|
||||
# run: |
|
||||
# vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||
|
||||
- name: Docker Compose Deployment
|
||||
uses: Autom3/docker-deployment-action@3.0.1
|
||||
with:
|
||||
remote_docker_host: gitea-deploy@192.168.1.254
|
||||
ssh_private_key: ${{ secrets.RINOA_GITEA_PRIVATE_SSH_KEY }}
|
||||
ssh_public_key: ${{ secrets.RINOA_GITEA_PUBLIC_SSH_KEY }}
|
||||
# - name: Docker Compose Deployment
|
||||
# uses: Autom3/docker-deployment-action@3.0.1
|
||||
# with:
|
||||
# remote_docker_host: gitea-deploy@192.168.1.254
|
||||
# ssh_private_key: ${{ secrets.RINOA_GITEA_PRIVATE_SSH_KEY }}
|
||||
# ssh_public_key: ${{ secrets.RINOA_GITEA_PUBLIC_SSH_KEY }}
|
||||
|
||||
Reference in New Issue
Block a user