Updated deployment pipeline; testing Vault action and README list.
This commit is contained in:
@@ -41,9 +41,12 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Generate ephemeral .env compose file
|
- name: Generate ephemeral .env compose file
|
||||||
id: generate-env-file-pr
|
uses: Simporter/get-env-file-from-vault@v1.0.2
|
||||||
run: |
|
with:
|
||||||
echo "${{ secrets.RINOA_ENV }}" > .env
|
VAULT_ADDR: https://vault.trez.wtf
|
||||||
|
VAULT_USERNAME: gitea
|
||||||
|
VAULT_PASSWORD: ${{ secrets.VAULT_GITEA_PASSWORD }}
|
||||||
|
VAULT_SECRETS_PATH: ${{ secrets.VAULT_SECRETS_PATH }}
|
||||||
|
|
||||||
- name: Docker Compose Lint
|
- name: Docker Compose Lint
|
||||||
uses: yu-ichiro/spin-up-docker-compose-action@v1
|
uses: yu-ichiro/spin-up-docker-compose-action@v1
|
||||||
@@ -87,6 +90,8 @@ 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
|
||||||
|
readme_list=$(yq '.services | to_entries | map({service: .key, image: .value.image})' docker-compose.yml)
|
||||||
|
echo "readme_list=${readme_list}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Compare Subdomains
|
- name: Compare Subdomains
|
||||||
id: compare-subdomains
|
id: compare-subdomains
|
||||||
@@ -109,7 +114,7 @@ jobs:
|
|||||||
flarectl dns create --zone "trez.wtf" --name "${subdomain}" --type=CNAME --content "trez.wtf"
|
flarectl dns create --zone "trez.wtf" --name "${subdomain}" --type=CNAME --content "trez.wtf"
|
||||||
done
|
done
|
||||||
|
|
||||||
merge-pr:
|
merge-pr-regenerate-readme:
|
||||||
name: PR Merge
|
name: PR Merge
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
@@ -118,11 +123,35 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Tea CLI Setup & PR Merge
|
- run: echo ${{ env.readme_list }}
|
||||||
run: |
|
|
||||||
curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea
|
# - name: Regenerate README
|
||||||
chmod +x /usr/local/bin/tea
|
# uses: VisualBean/reactive-readme@v1
|
||||||
echo "Merging PR..."
|
# with:
|
||||||
tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
|
# value: ${{ env.readme_list }}
|
||||||
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')
|
# section: compose-services
|
||||||
tea pr m --repo ${{ github.repository }} --title "${{ github.ref_name }} Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index}
|
# branch: ${{ github.ref_name }}
|
||||||
|
# token: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
|
||||||
|
# - name: Add/Commit/Push README.md
|
||||||
|
# uses: mgrybyk-org/git-commit-pull-push-action@v1
|
||||||
|
# with:
|
||||||
|
# add_args: README.md
|
||||||
|
# repository: ${{ github.repository }}
|
||||||
|
# branch: ${{ github.head_ref }}
|
||||||
|
# commit_message: Regenerate README.md
|
||||||
|
|
||||||
|
# - name: Install tea
|
||||||
|
# uses: supplypike/setup-bin@v4
|
||||||
|
# with:
|
||||||
|
# uri: https://dl.gitea.com/tea/main/tea-main-linux-amd64
|
||||||
|
# name: tea
|
||||||
|
# version: main
|
||||||
|
|
||||||
|
# - name: PR Merge
|
||||||
|
# run: |
|
||||||
|
# tea login add --name gitea-rinoa --url ${{ vars.RINOA_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
# 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}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user