Version 1.0.0-rc3 - Pipeline edit
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Frontend Deployment / deploy-frontend (push) Failing after 21s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Frontend Deployment / deploy-frontend (push) Failing after 21s
				
			This commit is contained in:
		@@ -8,41 +8,46 @@ on:
 | 
				
			|||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  deploy-frontend:
 | 
					  deploy-frontend:
 | 
				
			||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      # 1️⃣ Checkout du code
 | 
					 | 
				
			||||||
      - name: Checkout repository
 | 
					      - name: Checkout repository
 | 
				
			||||||
        uses: actions/checkout@v3
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # 2️⃣ Setup Node.js (ici Node 22)
 | 
					 | 
				
			||||||
      - name: Setup Node.js
 | 
					 | 
				
			||||||
        uses: actions/setup-node@v3
 | 
					 | 
				
			||||||
        with:
 | 
					 | 
				
			||||||
          node-version: '22'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      # 3️⃣ Installer les dépendances et builder le frontend
 | 
					 | 
				
			||||||
      - name: Build frontend
 | 
					 | 
				
			||||||
        run: |
 | 
					 | 
				
			||||||
          cd chopin-frontend
 | 
					 | 
				
			||||||
          npm install --omit=dev
 | 
					 | 
				
			||||||
          npm run build
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      # 4️⃣ Setup SSH pour la connexion vers alpha
 | 
					 | 
				
			||||||
      - name: Set up SSH
 | 
					      - name: Set up SSH
 | 
				
			||||||
        env:
 | 
					 | 
				
			||||||
          SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
 | 
					 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          mkdir -p ~/.ssh
 | 
					          mkdir -p ~/.ssh
 | 
				
			||||||
          echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
 | 
					          echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
 | 
				
			||||||
          chmod 600 ~/.ssh/id_rsa
 | 
					          chmod 600 ~/.ssh/id_rsa
 | 
				
			||||||
          ssh-keyscan alpha.raphix.fr >> ~/.ssh/known_hosts
 | 
					          ssh-keyscan -H alpha.raphix.fr >> ~/.ssh/known_hosts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # 5️⃣ Copier le build sur alpha
 | 
					      - name: Deploy frontend
 | 
				
			||||||
      - name: Deploy frontend to Alpha
 | 
					 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          rsync -av --delete chopin-frontend/dist/ raphix@alpha.raphix.fr:/home/gitlab-ci/chopin-frontend/dist/
 | 
					          ssh raphix@alpha.raphix.fr "
 | 
				
			||||||
 | 
					            set -e;
 | 
				
			||||||
 | 
					            APP_DIR=/home/gitlab-ci/chopin-frontend;
 | 
				
			||||||
 | 
					            REPO_URL=https://git.raphix.fr/subsonics/chopin-frontend;
 | 
				
			||||||
 | 
					            BRANCH=main;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # 6️⃣ Ajuster permissions sur alpha si nécessaire
 | 
					            echo '[Frontend-Deploy] - START';
 | 
				
			||||||
      - name: Set permissions on Alpha
 | 
					
 | 
				
			||||||
        run: |
 | 
					            mkdir -p \$APP_DIR;
 | 
				
			||||||
          ssh raphix@alpha.raphix.fr "sudo chown -R gitlab-ci:gitlab-ci /home/gitlab-ci/chopin-frontend/dist"
 | 
					
 | 
				
			||||||
 | 
					            if [ ! -d \$APP_DIR/.git ]; then
 | 
				
			||||||
 | 
					              echo 'Cloning repository...';
 | 
				
			||||||
 | 
					              git clone -b \$BRANCH \$REPO_URL \$APP_DIR;
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					              echo 'Updating repository...';
 | 
				
			||||||
 | 
					              cd \$APP_DIR;
 | 
				
			||||||
 | 
					              git fetch origin;
 | 
				
			||||||
 | 
					              git reset --hard origin/\$BRANCH;
 | 
				
			||||||
 | 
					            fi;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            cd \$APP_DIR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            echo 'Installing dependencies...';
 | 
				
			||||||
 | 
					            npm ci;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            echo 'Building app...';
 | 
				
			||||||
 | 
					            npm run build;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            echo '[Frontend-Deploy] - DONE';
 | 
				
			||||||
 | 
					          "
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user