rebuild config files #6
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: Configuration change deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
changed_files: | |
runs-on: ubuntu-latest | |
name: redeploy changed files | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
with: | |
files: docker-compose.yml, nginx.conf # Alternatively using: `docs/**` or `docs` | |
files_ignore: build/** | |
- name: List all changed files | |
run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "$file was changed" | |
done | |
- name: ssh pipeline | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: cross-the-world/ssh-pipeline@v1.2.0 | |
env: | |
BUILD_DIR: "~/tpc_portal/build" | |
with: | |
host: ${{ secrets.DC_HOST }} | |
user: ${{ secrets.DC_USER }} | |
pass: ${{ secrets.DC_PASS }} | |
script: | | |
cd $BUILD_DIR | |
git pull origin main | |
docker compose up -d --no-deps --build |