Changing merge, deploy trigger, and deployment order.
This commit is contained in:
@@ -58,7 +58,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate .env file for linting
|
- name: Generate .env file for linting
|
||||||
run: |
|
run: |
|
||||||
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||||
|
|
||||||
- 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
|
||||||
@@ -154,37 +154,13 @@ jobs:
|
|||||||
markdown_text: |
|
markdown_text: |
|
||||||
${{ steps.service-table.outputs.table }}
|
${{ steps.service-table.outputs.table }}
|
||||||
|
|
||||||
deployment-trigger:
|
merge-and-trigger:
|
||||||
name: Deployment Trigger
|
name: Merge PR & Trigger Deployment
|
||||||
needs: [generate-readme, docker-compose-test, regenerate-readme]
|
needs: [generate-readme, docker-compose-test, regenerate-readme]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Gotify Notification
|
- name: Checkout
|
||||||
uses: eikendev/gotify-action@master
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
|
||||||
gotify_app_token: '${{ secrets.RINOA_GOTIFY_TOKEN }}'
|
|
||||||
notification_title: 'Ready to Deploy'
|
|
||||||
notification_message: 'Ready to deploy: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'
|
|
||||||
|
|
||||||
- name: Trigger Deployment
|
|
||||||
id: deploy-trigger
|
|
||||||
uses: macnev2013/manual-approval@v1.0.18
|
|
||||||
with:
|
|
||||||
secret: ${{ github.TOKEN }}
|
|
||||||
approvers: Trez.One
|
|
||||||
minimum-approvals: 1
|
|
||||||
approval-wait: 600
|
|
||||||
issue-title: 'Manual Approval for #${{ steps.pr_merge.outputs.pr_index }} - ${{ gitea.ref_name }}'
|
|
||||||
issue-body: |
|
|
||||||
"Autobots, roll out!"
|
|
||||||
|
|
||||||
- name: Install tea
|
|
||||||
uses: supplypike/setup-bin@v4
|
|
||||||
with:
|
|
||||||
uri: 'https://gitea.com/gitea/tea/releases/download/v0.9.2/tea-0.9.2-linux-amd64'
|
|
||||||
name: 'tea'
|
|
||||||
version: '0.9.2'
|
|
||||||
|
|
||||||
- name: PR Merge
|
- name: PR Merge
|
||||||
id: pr_merge
|
id: pr_merge
|
||||||
@@ -202,30 +178,44 @@ jobs:
|
|||||||
if [ "${pr_state}" == "merged" ]; then
|
if [ "${pr_state}" == "merged" ]; then
|
||||||
break
|
break
|
||||||
|
|
||||||
# docker-compose-deploy:
|
- name: Gotify Notification
|
||||||
# name: Merge and Deploy
|
uses: eikendev/gotify-action@master
|
||||||
# runs-on: ubuntu-latest
|
with:
|
||||||
# needs: [deployment-trigger]
|
gotify_api_base: '${{ secrets.RINOA_GOTIFY_URL }}'
|
||||||
# env:
|
gotify_app_token: '${{ secrets.RINOA_GOTIFY_TOKEN }}'
|
||||||
# VAULT_ADDR: ${{ secrets.RINOA_VAULT_ADDR }}
|
notification_title: 'Ready to Deploy'
|
||||||
# VAULT_TOKEN: ${{ secrets.RINOA_VAULT_TOKEN }}
|
notification_message: 'Ready to deploy: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'
|
||||||
# steps:
|
|
||||||
# - name: Checkout
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
# with:
|
|
||||||
# ref: main
|
|
||||||
|
|
||||||
# - name: Install Vault
|
|
||||||
# uses: cpanato/vault-installer@main
|
|
||||||
|
|
||||||
# - name: Generate .env file for deployment
|
- name: manual-trigger
|
||||||
# run: |
|
id: manual-trigger
|
||||||
# vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
uses: benhamiltonpro/manual-trigger@v1
|
||||||
|
with:
|
||||||
|
RUN_NAME: "merge-and-deploy"
|
||||||
|
|
||||||
# - name: Docker Compose Deployment
|
docker-compose-deploy:
|
||||||
# uses: Autom3/docker-deployment-action@3.0.1
|
name: Deploy via Docker Compose
|
||||||
# with:
|
runs-on: ubuntu-latest
|
||||||
# remote_docker_host: gitea-deploy@192.168.1.254
|
needs: [deployment-trigger]
|
||||||
# ssh_private_key: ${{ secrets.RINOA_GITEA_PRIVATE_SSH_KEY }}
|
env:
|
||||||
# ssh_public_key: ${{ secrets.RINOA_GITEA_PUBLIC_SSH_KEY }}
|
VAULT_ADDR: ${{ secrets.RINOA_VAULT_ADDR }}
|
||||||
|
VAULT_TOKEN: ${{ secrets.RINOA_VAULT_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
|
||||||
|
- name: Install Vault
|
||||||
|
uses: cpanato/vault-installer@main
|
||||||
|
|
||||||
|
- name: Generate .env file for deployment
|
||||||
|
run: |
|
||||||
|
vault kv get -format=json rinoa-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
|
||||||
|
|
||||||
|
- name: Docker Compose Deployment
|
||||||
|
uses: Autom3/docker-deployment-action@3.0.1
|
||||||
|
with:
|
||||||
|
remote_docker_host: gitea-deploy@192.168.1.254
|
||||||
|
ssh_private_key: ${{ secrets.RINOA_GITEA_PRIVATE_SSH_KEY }}
|
||||||
|
ssh_public_key: ${{ secrets.RINOA_GITEA_PUBLIC_SSH_KEY }}
|
||||||
|
|
||||||
Reference in New Issue
Block a user