feat: test CI
This commit is contained in:
		
							
								
								
									
										77
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,77 @@ | ||||
| name: ci | ||||
|  | ||||
| on: [push] | ||||
|  | ||||
| jobs: | ||||
|   lint: | ||||
|     name: Lint GSC files | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Install Git LFS | ||||
|         run: | | ||||
|           apt-get update | ||||
|           apt-get install -y git-lfs | ||||
|           git lfs install | ||||
|  | ||||
|       - name: Check out files | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           submodules: true | ||||
|           fetch-depth: 0 | ||||
|           lfs: true | ||||
|  | ||||
|       - name: Lint | ||||
|         uses: addnab/docker-run-action@v3 | ||||
|         with: | ||||
|           registry: gcr.io | ||||
|           image: xensik/gsc-tool:latest | ||||
|           options: --volumes-from=${{ env.JOB_CONTAINER_NAME }} | ||||
|           run: | | ||||
|             cd ${{ github.workspace }} | ||||
|             gsc-tool --dry -m comp -g iw6 -s pc "maps" | ||||
|             gsc-tool --dry -m parse -g iw6 -s pc "scripts" | ||||
|  | ||||
|       - name: Upload data artifacts | ||||
|         if: github.ref == 'refs/heads/main' | ||||
|         uses: actions/upload-artifact@main | ||||
|         with: | ||||
|           name: data artifacts | ||||
|           path: | | ||||
|             data/* | ||||
|  | ||||
|   deploy: | ||||
|     name: Deploy artifacts | ||||
|     needs: [lint] | ||||
|     runs-on: ubuntu-latest | ||||
|     if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||||
|     steps: | ||||
|       - name: Install dependencies | ||||
|         run: | | ||||
|           apt-get update | ||||
|           apt-get install -y rsync | ||||
|  | ||||
|       - name: Setup main environment | ||||
|         run: echo "ALTERWARE_MASTER_SERVER_PATH=${{ secrets.ALTERWARE_MASTER_SSH_PATH  }}" >> $GITHUB_ENV | ||||
|  | ||||
|       - name: Download data artifacts | ||||
|         uses: actions/download-artifact@v4 | ||||
|         with: | ||||
|           name: data artifacts | ||||
|  | ||||
|       - name: Install SSH key | ||||
|         uses: shimataro/ssh-key-action@v2.7.0 | ||||
|         with: | ||||
|           key: ${{ secrets.ALTERWARE_MASTER_SSH_PRIVATE_KEY }} | ||||
|           known_hosts: 'just-a-placeholder-so-we-dont-get-errors' | ||||
|  | ||||
|       - name: Add known hosts | ||||
|         run: ssh-keyscan -H ${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }} >> ~/.ssh/known_hosts | ||||
|  | ||||
|       - name: Remove old data files | ||||
|         run: ssh ${{ secrets.ALTERWARE_MASTER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }} rm -rf ${{ env.ALTERWARE_MASTER_SERVER_PATH }}/iw6/data/* | ||||
|  | ||||
|       - name: Upload data files | ||||
|         run: rsync -avz ./data/ ${{ secrets.ALTERWARE_MASTER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }}:${{ env.ALTERWARE_MASTER_SERVER_PATH }}/iw6/data/ | ||||
|  | ||||
|       - name: Publish changes | ||||
|         run: ssh ${{ secrets.ALTERWARE_MASTER_SSH_USER }}@${{ secrets.ALTERWARE_MASTER_SSH_ADDRESS }} ${{ secrets.ALTERWARE_SSH_CHANGE_PUBLISH_COMMAND }} | ||||
| @@ -1,22 +0,0 @@ | ||||
| name: lint | ||||
|  | ||||
| on: [push] | ||||
|  | ||||
| jobs: | ||||
|   lint: | ||||
|     name: Lint GSC files | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Check out files | ||||
|         uses: actions/checkout@v4 | ||||
|  | ||||
|       - name: Lint | ||||
|         uses: addnab/docker-run-action@v3 | ||||
|         with: | ||||
|           registry: gcr.io | ||||
|           image: xensik/gsc-tool:latest | ||||
|           options: --volumes-from=${{ env.JOB_CONTAINER_NAME }} | ||||
|           run: | | ||||
|             cd ${{ github.workspace }} | ||||
|             gsc-tool --dry -m comp -g iw6 -s pc "maps" | ||||
|             gsc-tool --dry -m parse -g iw6 -s pc "scripts" | ||||
		Reference in New Issue
	
	Block a user