...
This commit is contained in:
@@ -24,20 +24,17 @@ jobs:
|
|||||||
- name: Install yq
|
- name: Install yq
|
||||||
uses: dcarbone/install-yq-action@v1
|
uses: dcarbone/install-yq-action@v1
|
||||||
|
|
||||||
- name: PR list
|
- name: Check if PR exists & Create
|
||||||
id: list-prs
|
id: list-prs
|
||||||
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 pr ls --repo ${{ gitea.repository }} --state all --output yaml
|
tea login default gitea-rinoa
|
||||||
echo "pr_state=$(tea pr ls --repo ${{ gitea.repository }} --state open --output yaml | yq '.[].state')" >> $GITHUB_OUTPUT
|
pr_state=$(tea pr ls --repo ${{ gitea.repository }} --state open --output yaml | yq '.[].state')
|
||||||
|
if [ ${pr_state} != 'open' ]; then
|
||||||
- name: Create PR
|
tea pr c -r ${{ gitea.repository }} -t "Automated PR for ${{ github.ref_name }}" -d "Automated PR for ${{ github.ref_name }}"
|
||||||
if: steps.list-prs.outputs.pr_state != '"open"'
|
elif [ ${pr_state} == 'open' ]; then
|
||||||
uses: arifer612/Gitea-PR-action@v1.2.0
|
echo "PR already exists, skipping creation..."
|
||||||
with:
|
fi
|
||||||
url: ${{ github.server_url }}
|
|
||||||
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
|
||||||
pr-label: 'auto-deploy-pr'
|
|
||||||
|
|
||||||
docker-compose-test:
|
docker-compose-test:
|
||||||
name: Docker Compose Test
|
name: Docker Compose Test
|
||||||
@@ -97,7 +94,6 @@ jobs:
|
|||||||
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt
|
||||||
echo "Grabbing subdomains from Cloudflare..."
|
echo "Grabbing subdomains from Cloudflare..."
|
||||||
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
flarectl --json dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf" | jq '.[].Name' | sed -e 's|"||g' | awk -F"." '{print $1}' | sort > cloudflare_subdomains.txt
|
||||||
yq '.services | to_entries | map({service: .key, image: .value.image})' docker-compose.yml
|
|
||||||
|
|
||||||
- name: Compare Subdomains
|
- name: Compare Subdomains
|
||||||
id: compare-subdomains
|
id: compare-subdomains
|
||||||
@@ -129,15 +125,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: echo ${{ env.readme_list }}
|
- name: Install yq
|
||||||
|
uses: dcarbone/install-yq-action@v1
|
||||||
|
|
||||||
|
- name: Generate README list
|
||||||
|
id: readme-list
|
||||||
|
run: |
|
||||||
|
services_list=$(yq '.services | to_entries | map({service: .key, image: .value.image})' docker-compose.yml)
|
||||||
|
echo "SERVICES_LIST=${services_list}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: Regenerate README
|
- name: Regenerate README
|
||||||
# uses: VisualBean/reactive-readme@v1
|
uses: VisualBean/reactive-readme@v1
|
||||||
# with:
|
with:
|
||||||
# value: ${{ env.readme_list }}
|
value: ${{ env.SERVICES_LIST }}
|
||||||
# section: compose-services
|
section: compose-services
|
||||||
# branch: ${{ github.ref_name }}
|
branch: ${{ github.ref_name }}
|
||||||
# token: ${{ secrets.BOT_GITEA_TOKEN }}
|
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
|
||||||
# - name: Add/Commit/Push README.md
|
# - name: Add/Commit/Push README.md
|
||||||
# uses: mgrybyk-org/git-commit-pull-push-action@v1
|
# uses: mgrybyk-org/git-commit-pull-push-action@v1
|
||||||
|
|||||||
Reference in New Issue
Block a user