Build All and Deploy #15
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: Build All and Deploy | |
on: | |
workflow_dispatch: | |
permissions: | |
packages: write | |
jobs: | |
build_app: | |
uses: ./.github/workflows/build-component.yaml | |
with: | |
component: app | |
build_server: | |
uses: ./.github/workflows/build-component.yaml | |
with: | |
component: server | |
deploy_all: | |
runs-on: ubuntu-latest | |
needs: [build_app, build_server] | |
steps: | |
- name: Configure ssh key | |
env: | |
PRIVATE_KEY: ${{ secrets.GROCERIES_PRIVATE_KEY }} | |
run: | | |
echo "$PRIVATE_KEY" > id_rsa_groceries | |
chmod 600 id_rsa_groceries | |
- name: Docker Compose up | |
env: | |
HOST: "149.130.209.48" | |
run: | | |
ssh -i id_rsa_groceries -o "StrictHostKeyChecking no" groceries@$HOST " | |
curl -o docker-compose.yaml https://raw.githubusercontent.com/collinmurd/groceries/main/docker-compose-prod.yaml | |
docker compose up -d | |
" |