Skip to content

Build & Deploy

Build & Deploy #297

Workflow file for this run

name: Build & Deploy
on:
# Manually triggered from the UI
workflow_dispatch:
inputs:
environment:
description: "Environment"
required: true
type: environment
# Dependency to a forking workflow
#workflow_run:
# workflows: ["Django CI"]
# types: [completed]
jobs:
build_docker:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
concurrency: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v4
- name: Login to packages container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
make build-docker-image
make tag-${{ github.event.inputs.environment }}
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: maaa-registration
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
proxy_host: ${{ secrets.SSH_HOST }}
proxy_username: ${{ secrets.SSH_USERNAME }}
proxy_key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /opt/docker
docker-compose pull
docker-compose up -d