mirror of
				https://github.com/HackTricks-wiki/hacktricks.git
				synced 2025-10-10 18:36:50 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			65 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Build Master
 | 
						|
 | 
						|
on:
 | 
						|
  push:
 | 
						|
    branches:
 | 
						|
      - master
 | 
						|
    paths-ignore:
 | 
						|
      - 'scripts/**'
 | 
						|
      - '.gitignore'
 | 
						|
      - '.github/**'
 | 
						|
      - 'book/**'
 | 
						|
  workflow_dispatch:
 | 
						|
 | 
						|
concurrency: build_master
 | 
						|
 | 
						|
permissions:
 | 
						|
  packages: write
 | 
						|
  id-token: write
 | 
						|
  contents: write
 | 
						|
 | 
						|
jobs:
 | 
						|
  run-translation:
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
    container:
 | 
						|
      image: ghcr.io/hacktricks-wiki/hacktricks-cloud/translator-image:latest
 | 
						|
    environment: prod
 | 
						|
 | 
						|
    steps:
 | 
						|
      - name: Checkout code
 | 
						|
        uses: actions/checkout@v4
 | 
						|
        with:
 | 
						|
          fetch-depth: 0 #Needed to download everything to be able to access the master & language branches
 | 
						|
      
 | 
						|
      # Build the mdBook
 | 
						|
      - name: Build mdBook
 | 
						|
        run: MDBOOK_BOOK__LANGUAGE=en mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && echo "" && echo "" && echo "Debug logs" && (cat hacktricks-preprocessor.log | tail -n 20) && exit 1)
 | 
						|
      
 | 
						|
      - name: Update searchindex in repo
 | 
						|
        run: |
 | 
						|
          ls -la
 | 
						|
          ls -la book
 | 
						|
          git config --global --add safe.directory /__w/hacktricks/hacktricks
 | 
						|
          git pull
 | 
						|
          git config --global user.email "build@example.com"
 | 
						|
          git config --global user.name "Build master"
 | 
						|
          git config pull.rebase false
 | 
						|
          if [ -f "book/searchindex.js" ]; then
 | 
						|
            cp book/searchindex.js searchindex.js
 | 
						|
          fi
 | 
						|
          (git add searchindex.js;
 | 
						|
          git commit -m "Update searchindex";
 | 
						|
          git push) || echo "No changes to searchindex.js"
 | 
						|
 | 
						|
      # Login in AWs
 | 
						|
      - name: Configure AWS credentials using OIDC
 | 
						|
        uses: aws-actions/configure-aws-credentials@v3
 | 
						|
        with:
 | 
						|
          role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
 | 
						|
          aws-region: us-east-1
 | 
						|
      
 | 
						|
      # Sync the build to S3
 | 
						|
      - name: Sync to S3
 | 
						|
        run: aws s3 sync ./book s3://hacktricks-wiki/en --delete
 | 
						|
      
 |