-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.11 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "CD: Deployment"
on:
push:
branches: [main]
workflow_dispatch:
jobs:
ignore_repository_deployment:
name: "⏭️ Ignore repository deployment"
runs-on: ubuntu-latest
steps:
- name: "🛃 Compare repository urls"
run: |
url="${{ secrets.DEPLOYMENT_URL }}"
url="${url%.git}"
repo=$(echo "$url" | awk -F ':' '{print $2}')
if [ "${{ github.repository }}" == "$repo" ]; then
echo "ignore=true" >> $GITHUB_OUTPUT
else
echo "ignore=false" >> $GITHUB_OUTPUT
fi
repository_mirroring:
name: "🚀 Repository mirroring"
runs-on: ubuntu-latest
needs: ignore_repository_deployment
if: ${{ needs.ignore_repository_deployment.outputs.ignore != 'true' }}
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "🚀 Epitech mirroring"
uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: ${{ secrets.DEPLOYMENT_URL }}
ssh_private_key: ${{ secrets.DEPLOYMENT_SSH_KEY }}