Updated deployment pipeline; testing Vault action and README list.
This commit is contained in:
@@ -41,9 +41,12 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate ephemeral .env compose file
|
||||
id: generate-env-file-pr
|
||||
run: |
|
||||
echo "${{ secrets.RINOA_ENV }}" > .env
|
||||
uses: Simporter/get-env-file-from-vault@v1.0.2
|
||||
with:
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
id: compare-subdomains
|
||||
@@ -109,7 +114,7 @@ jobs:
|
||||
flarectl dns create --zone "trez.wtf" --name "${subdomain}" --type=CNAME --content "trez.wtf"
|
||||
done
|
||||
|
||||
merge-pr:
|
||||
merge-pr-regenerate-readme:
|
||||
name: PR Merge
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ always() }}
|
||||
@@ -118,11 +123,35 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Tea CLI Setup & PR Merge
|
||||
run: |
|
||||
curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea
|
||||
chmod +x /usr/local/bin/tea
|
||||
echo "Merging PR..."
|
||||
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 "${{ github.ref_name }} Auto Merge" --message "Merged by ${{ gitea.actor }}" --output table ${pr_index}
|
||||
- run: echo ${{ env.readme_list }}
|
||||
|
||||
# - name: Regenerate README
|
||||
# uses: VisualBean/reactive-readme@v1
|
||||
# with:
|
||||
# value: ${{ env.readme_list }}
|
||||
# section: compose-services
|
||||
# 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