CD | Production specific Make tasks #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | Production specific Make tasks | |
on: | |
workflow_dispatch: | |
inputs: | |
tasks: | |
description: 'Make tasks to run' | |
required: true | |
type: string | |
workflow_call: | |
inputs: | |
tasks: | |
description: 'Make tasks to run' | |
required: true | |
type: string | |
jobs: | |
deploy-frontman: | |
name: Deploy on production | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Save known_hosts file | |
env: | |
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }} | |
shell: bash | |
run: | | |
mkdir -p ~/.ssh | |
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts | |
- name: Save id_rsa file | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
shell: bash | |
run: | | |
echo "$SSH_PRIVATE_KEY" > id_rsa && chmod 600 id_rsa | |
- name: Render HOSTS secret into config/hosts.yml | |
env: | |
HOSTS: ${{ secrets.HOSTS }} | |
shell: bash | |
run: | | |
echo "$HOSTS" > config/hosts.yml | |
- name: Render METRICS secret into config/metrics.yml | |
env: | |
METRICS: ${{ secrets.METRICS }} | |
shell: bash | |
run: | | |
echo "$METRICS" > config/metrics.yml | |
- name: Render SERVERS secret into config/servers.yml | |
env: | |
SERVERS: ${{ secrets.SERVERS }} | |
shell: bash | |
run: | | |
echo "$SERVERS" > config/servers.yml | |
- name: Render SUPABASE secret into config/supabase.yml | |
env: | |
SUPABASE: ${{ secrets.SUPABASE }} | |
shell: bash | |
run: | | |
echo "$SUPABASE" > config/supabase.yml | |
- name: Run playbook | |
shell: bash | |
run: make ${{ inputs.tasks }} |