Skip to content

Commit

Permalink
Update deploy.yaml to trigger jobs based on file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nishogi committed Jun 1, 2024
1 parent c4eb3e1 commit 762a73d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deployment
name: Deployment

on:
push:
Expand All @@ -7,14 +7,13 @@ on:

jobs:
deploy-eden:
if: contains(github.event.head_commit.message, 'website')
runs-on: self-hosted

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Deploy EDEN
if: ${{ contains(github.event.head_commit.message, 'website') || github.event_name == 'push' && (github.ref == 'refs/heads/main' && (github.event.commits | contains (value => contains(value.modified, 'website/')))) }}
env:
TARGET_PATH: /var/www/edend12.imtbs-tsp.eu
run: |
Expand All @@ -23,31 +22,28 @@ jobs:
cp -R ./website $TARGET_PATH
copy-proxy-config:
if: contains(github.event.head_commit.message, 'proxy')
runs-on: self-hosted

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Deploy Proxy
if: ${{ contains(github.event.head_commit.message, 'proxy') || github.event_name == 'push' && (github.ref == 'refs/heads/main' && (github.event.commits | contains (value => contains(value.modified, 'proxy/')))) }}
env:
TARGET_PATH: /opt/EDEN/proxy
run: |
rm -rf $TARGET_PATH.bak
cp -R $TARGET_PATH $TARGET_PATH.bak
cp -R ./proxy $TARGET_PATH
copy-tofu-config:
if: contains(github.event.head_commit.message, 'tofu')
runs-on: self-hosted

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Deploy Tofu
if: ${{ contains(github.event.head_commit.message, 'tofu') || github.event_name == 'push' && (github.ref == 'refs/heads/main' && (github.event.commits | contains (value => contains(value.modified, 'tofu/')))) }}
env:
TARGET_PATH: /var/www/tofu
run: |
Expand All @@ -56,14 +52,13 @@ jobs:
cp -R ./tofu $TARGET_PATH
copy-dns-config:
if: contains(github.event.head_commit.message, 'dns')
runs-on: self-hosted

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Deploy DNS
if: ${{ contains(github.event.head_commit.message, 'dns') || github.event_name == 'push' && (github.ref == 'refs/heads/main' && (github.event.commits | contains (value => contains(value.modified, 'dns/')))) }}
env:
TARGET_PATH: /opt/EDEN/dns
run: |
Expand Down

0 comments on commit 762a73d

Please sign in to comment.