Changing merge, deploy trigger, and deployment order.
This commit is contained in:
@@ -58,7 +58,7 @@ jobs:
|
||||
|
||||
- name: Generate .env file for linting
|
||||
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
|
||||
uses: yu-ichiro/spin-up-docker-compose-action@v1
|
||||
@@ -154,37 +154,13 @@ jobs:
|
||||
markdown_text: |
|
||||
${{ steps.service-table.outputs.table }}
|
||||
|
||||
deployment-trigger:
|
||||
name: Deployment Trigger
|
||||
merge-and-trigger:
|
||||
name: Merge PR & Trigger Deployment
|
||||
needs: [generate-readme, docker-compose-test, regenerate-readme]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Gotify Notification
|
||||
uses: eikendev/gotify-action@master
|
||||
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: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: PR Merge
|
||||
id: pr_merge
|
||||
@@ -202,30 +178,44 @@ jobs:
|
||||
if [ "${pr_state}" == "merged" ]; then
|
||||
break
|
||||
|
||||
# docker-compose-deploy:
|
||||
# name: Merge and Deploy
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [deployment-trigger]
|
||||
# env:
|
||||
# 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: Gotify Notification
|
||||
uses: eikendev/gotify-action@master
|
||||
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: 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: manual-trigger
|
||||
id: manual-trigger
|
||||
uses: benhamiltonpro/manual-trigger@v1
|
||||
with:
|
||||
RUN_NAME: "merge-and-deploy"
|
||||
|
||||
# - 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 }}
|
||||
docker-compose-deploy:
|
||||
name: Deploy via Docker Compose
|
||||
runs-on: ubuntu-latest
|
||||
needs: [deployment-trigger]
|
||||
env:
|
||||
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