GitHub Actions - Add mirror task

This commit is contained in:
Jakub Chrzanowski 2020-04-03 13:00:50 +02:00 committed by GitHub
parent ec4eb6e7a5
commit 1f48aabfc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
name: build-test
name: Build, Test, Mirror
on: [push, pull_request]
jobs:
@ -70,3 +70,21 @@ jobs:
${{ runner.os }}-gradle-
- name: Verify Plugin
run: gradle -p code_samples/${{ matrix.plugin }} verifyPlugin
mirror:
name: Code Samples Mirror
if: github.ref == 'refs/heads/master'
needs: samples
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Prepare Mirror
run: |
git clone --bare git@github.com:JetBrains/intellij-sdk-docs.git .
git branch | grep -v "master" | xargs git branch -D
git filter-branch --prune-empty --subdirectory-filter code_samples master
git push --mirror git@github.com:JetBrains/intellij-sdk-code-samples.git