Skip to content

merge: pull request #126 from G-Epitech/sever-prevent-new-players-aft… #42

merge: pull request #126 from G-Epitech/sever-prevent-new-players-aft…

merge: pull request #126 from G-Epitech/sever-prevent-new-players-aft… #42

Workflow file for this run

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 }}