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