hacktoberfestdark-themesonarrradarrplexorganizrnginxthemesubfilterguacamoleskinsombilidarrdocker-modsdark-themesdark-modecustom-csscssthemes-customthemes-css
		
		
		
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							88 lines
						
					
					
						
							2.8 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							88 lines
						
					
					
						
							2.8 KiB
						
					
					
				| name: Minify CSS and deploy to live branch | |
| on: | |
|   push: | |
|     branches: | |
|       - master | |
|       - develop | |
|       - testing  | |
|     paths-ignore: | |
|         - 'docker-mods/**' | |
|         - '.vscode/**' | |
|         - '.github/**' | |
|   workflow_dispatch: | |
|     inputs: | |
|       branch: | |
|         description: 'Select branch' | |
|         required: true | |
|         type: choice | |
|         options: | |
|         - master | |
|         - develop | |
|         - testing | |
| jobs: | |
|   deploy: | |
|     runs-on: ubuntu-latest | |
|     steps: | |
|       - uses: actions/checkout@v2 | |
|         with: | |
|           fetch-depth: 0 | |
|       - name: Wrong domain check | |
|         run: | | |
|           echo "$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }})" | |
|           if git grep -q -E ${{ secrets.DOMAIN }} -- *.css; then | |
|             echo "Game over man!" | |
|             exit 1 | |
|           fi           | |
|       - name: Set up Python ${{ matrix.python-version }} | |
|         uses: actions/setup-python@v2 | |
|       - name: Run themes.py | |
|         run: | | |
|                     python themes.py | |
|       - name: Minify CSS | |
|         if: ${{ github.ref == 'refs/heads/master' }} | |
|         run: | | |
|           sudo npm install -g minify@7.2.2 | |
|           sudo apt-get update | |
|           sudo apt-get -y install moreutils | |
|  | |
|           minify_file(){ | |
|               directory=$1 | |
|               basename=$(basename $directory); | |
|               extension="${basename##*.}" | |
|               output="${directory%/*}/" | |
|               filename="${basename%.*}" | |
|               output_path="${output}${filename}.${extension}" | |
|               minify ${directory} | sponge ${output_path} | |
|               echo "Minified ${directory} > ${output_path}" | |
|           } | |
|            | |
|             find ./css -type f -iname *base.css | while read fname | |
|                 do | |
|                     if [[ "$fname" != *"min."* ]]; then | |
|                         minify_file $fname | |
|                     fi | |
|                 done           | |
|       - name: Deploy | |
|         uses: peaceiris/actions-gh-pages@v3 | |
|         if: ${{ github.ref == 'refs/heads/master' || github.event.inputs.branch == 'master' }} | |
|         with: | |
|           publish_dir: ./ | |
|           publish_branch: live | |
|           github_token: ${{ secrets.GITHUB_TOKEN }} | |
|           exclude_assets: '' | |
|       - name: Deploy Develop | |
|         uses: peaceiris/actions-gh-pages@v3 | |
|         if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} | |
|         with: | |
|           publish_dir: ./ | |
|           publish_branch: live_develop | |
|           github_token: ${{ secrets.GITHUB_TOKEN }} | |
|           exclude_assets: '' | |
|       - name: Deploy Testing | |
|         uses: peaceiris/actions-gh-pages@v3 | |
|         if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} | |
|         with: | |
|           publish_dir: ./ | |
|           publish_branch: live_testing | |
|           github_token: ${{ secrets.GITHUB_TOKEN }} | |
|           exclude_assets: '' |