fix(ip-masking): added 172.19.0.0/12 subnet (#142) #10
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: Continuous Deployment for Metakgp-Wiki | |
on: | |
push: | |
branches: | |
- "master" | |
paths: | |
- "jobs/**" | |
- "mediawiki/**" | |
- "mysql/**" | |
- "nginx/**" | |
- "docker-compose.prod.yml" | |
- "docker-compose.yml" | |
- ".github/workflows/deploy.yaml" | |
workflow_dispatch: # This allows us to trigger the workflow manually | |
jobs: | |
push: | |
name: Push Stage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync local repo with remote repo | |
uses: appleboy/ssh-action@master | |
env: | |
PROJECT_DIR: ${{ secrets.PROJECT_DIR }} | |
with: | |
host: ${{ secrets.SSH_HOSTNAME }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }} | |
envs: PROJECT_DIR | |
script_stop: true | |
script: | | |
cd "${PROJECT_DIR}/" | |
sudo git fetch origin | |
sudo git reset --hard origin/master | |
build: | |
name: Build Stage | |
needs: push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build the latest container(s) | |
uses: appleboy/ssh-action@master | |
env: | |
PROJECT_DIR: ${{ secrets.PROJECT_DIR }} | |
with: | |
host: ${{ secrets.SSH_HOSTNAME }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }} | |
command_timeout: 60m | |
envs: PROJECT_DIR | |
script_stop: true | |
script: | | |
cd "${PROJECT_DIR}/" | |
sudo docker compose -f docker-compose.prod.yml build | |
deploy: | |
name: Deploy Stage | |
needs: [push, build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy the latest build(s) | |
uses: appleboy/ssh-action@master | |
env: | |
PROJECT_DIR: ${{ secrets.PROJECT_DIR }} | |
with: | |
host: ${{ secrets.SSH_HOSTNAME }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }} | |
envs: PROJECT_DIR | |
script_stop: true | |
script: | | |
cd "${PROJECT_DIR}/" | |
sudo docker compose -f docker-compose.prod.yml down | |
sudo docker volume rm metakgp-wiki_mediawiki-volume | |
sudo docker compose -f docker-compose.prod.yml up -d |