...
This commit is contained in:
@@ -70,30 +70,21 @@ jobs:
|
|||||||
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
||||||
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
|
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
|
||||||
run: |
|
run: |
|
||||||
flarectl dns list --zone "trez.wtf" --type=CNAME --content "trez.wtf"
|
|
||||||
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[].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
|
||||||
|
diff compose_subdomains.txt cloudflare_subdomains.txt > missing_subdomains.txt || true
|
||||||
|
echo "::set-output name=output::$(cat missing_subdomains.txt)"
|
||||||
|
|
||||||
- name: Compare Subdomains
|
- name: Add missing subdomains to Cloudflare
|
||||||
id: compare-subdomains
|
if: steps.compare-subdomains.outputs.output != ''
|
||||||
uses: LouisBrunner/diff-action@v2.2.0
|
env:
|
||||||
with:
|
CF_API_KEY: ${{ secrets.CF_API_TOKEN }}
|
||||||
old: cloudflare_subdomains.txt
|
CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
|
||||||
new: compose_subdomains.txt
|
run: |
|
||||||
mode: addition
|
for subdomain in $(cat missing_subdomains.txt); do
|
||||||
tolerance: mixed-better
|
echo "Adding ${subdomain} to Cloudflare..."
|
||||||
output: missing_subdomains.txt
|
flarectl dns creeate --zone ${{ secrets.CF_ZONE_ID }} --type CNAME --name "${subdomain}" --content "trez.wtf" --proxy true
|
||||||
|
done
|
||||||
# - name: Add missing subdomains to Cloudflare
|
|
||||||
# if: steps.compare-subdomains.outputs.output != ''
|
|
||||||
# env:
|
|
||||||
# CF_API_KEY: ${{ secrets.CF_API_TOKEN }}
|
|
||||||
# CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }}
|
|
||||||
# run: |
|
|
||||||
# for subdomain in $(cat missing_subdomains.txt); do
|
|
||||||
# echo "Adding ${subdomain} to Cloudflare..."
|
|
||||||
# flarectl dns creeate --zone ${{ secrets.CF_ZONE_ID }} --type CNAME --name "${subdomain}" --content "trez.wtf" --proxy true
|
|
||||||
# done
|
|
||||||
|
|
||||||
# docker-compose-test:
|
# docker-compose-test:
|
||||||
# name: Docker Compose Test
|
# name: Docker Compose Test
|
||||||
|
|||||||
Reference in New Issue
Block a user