Update Achievements 3 #13
This file contains hidden or 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: Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Step 2: Set up Node.js | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 # Use the Node.js version compatible with your project | |
| # Step 3: Install dependencies | |
| - name: Install dependencies | |
| run: npm install | |
| # Step 4: Build the project | |
| - name: Build the project | |
| run: npm run build | |
| # Step 5: Deploy to the docs folder | |
| - name: Deploy to docs folder | |
| run: | | |
| rm -rf docs | |
| mv dist docs | |
| # Step 6: Commit and push changes | |
| - name: Commit and push changes | |
| run: | | |
| git config --local user.name "GitHub Actions" | |
| git config --local user.email "[email protected]" | |
| git add docs | |
| git commit -m "Automatic Deploy" | |
| git push | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write | |
| steps: | |
| # Étape 1 : Vérifier le code | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Étape 2 : Configurer Git | |
| - name: Configure Git | |
| run: | | |
| git config --local user.name "GitHub Actions" | |
| git config --local user.email "[email protected]" | |
| # Étape 3 : Fusionner develop dans main | |
| - name: Merge develop into main | |
| run: | | |
| git fetch origin | |
| git checkout main | |
| git merge origin/develop --allow-unrelated-histories -X theirs | |
| # Étape 4 : Pousser les modifications | |
| - name: Push changes | |
| run: | | |
| git push origin main |