From 78400eec0823b27f79992f9ab7cb142b0f8e089b Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Fri, 3 Jan 2025 10:15:08 -0500 Subject: [PATCH] Updated catche step, flarectl install, and subdomain extraction. --- .gitea/workflows/deployment.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/deployment.yml b/.gitea/workflows/deployment.yml index 945f26d3..ca5d36bd 100644 --- a/.gitea/workflows/deployment.yml +++ b/.gitea/workflows/deployment.yml @@ -46,8 +46,6 @@ jobs: path: | ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Setup yq uses: dcarbone/install-yq-action@v1 @@ -61,29 +59,18 @@ jobs: - name: Setup jq uses: dcarbone/install-jq-action@v3.0.1 - - name: Retrieve Subdomains from Cloudflare + - name: Install flarectl + if: steps.cache-flarectl.outputs.cache-hit != 'true' + run: | + go install github.com/cloudflare/cloudflare-go/cmd/flarectl@latest + + - name: Retrieve Subdomains from Cloudflare & Compose id: retrieve-cloudflare-subdomains env: CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }} run: | - go env - # Check if flarectl exists; install if not cached - if ! command -v flarectl &> /dev/null; then - echo "flarectl not found, installing..." - go env ${{ github.workspace }} - go install github.com/cloudflare/cloudflare-go/cmd/flarectl@latest - else - echo "flarectl found in cache." - fi 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 - - - name: Grab subdomains from Compose - id: compose-domains - env: - CF_API_KEY: ${{ secrets.CF_API_TOKEN }} - CF_API_EMAIL: ${{ secrets.CF_API_EMAIL }} - run: | yq '.services[].labels.swag_url' docker-compose.yml | egrep -v 'null' | sed -e 's|"||g' | awk -F'.' '{print $1}' | sort > compose_subdomains.txt - name: Compare Subdomains