fix: check workshop/presentation capacity on payment #22
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: Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Compose | |
uses: ndeloof/[email protected] | |
with: | |
version: v2.20.2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build docker images | |
run: docker compose build | |
- name: Push docker images | |
run: docker compose push backend | |
deploy: | |
needs: build-and-push | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Copy files to VM | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ vars.VM_HOST }} | |
username: ${{ vars.VM_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
overwrite: true | |
source: "docker-compose.yml,deployment" | |
target: /home/${{ vars.VM_USERNAME }}/AAISS-2023 | |
- name: Deploy to the VM | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ vars.VM_HOST }} | |
username: ${{ vars.VM_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
# TODO: handle envs | |
script: | | |
docker compose -f AAISS-2023/docker-compose.yml up -d --pull always --force-recreate |