9 types: [synchronize, opened]
14 runs-on: ubuntu-latest
17 CI_BRANCH_BASE: develop
20 - uses: actions/checkout@v2
23 uses: actions/setup-node@v1
27 - name: Cache Node.js modules
28 uses: actions/cache@v2
32 key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
34 ${{ runner.OS }}-node-
37 - name: Install dependencies
38 run: yarn install --frozen-lockfile
40 - name: Angular bundlewatch
41 uses: jackyef/bundlewatch-gh-action@master
43 build-script: npm run build -- --analyze-bundle
45 bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
47 - name: PeerTube client stats
48 if: github.event_name != 'pull_request'
50 node dist/scripts/client-build-stats.js > client-build-stats.json
52 - name: PeerTube code stats
53 if: github.event_name != 'pull_request'
55 wget "https://github.com/boyter/scc/releases/download/v3.0.0/scc-3.0.0-x86_64-unknown-linux.zip"
56 unzip "scc-3.0.0-x86_64-unknown-linux.zip"
57 ./scc --format=json --exclude-dir .git,node_modules,client/node_modules,client/dist,dist,yarn.lock,client/yarn.lock,client/src/locale,test1,test2,test3,client/src/assets/images,config,storage,server/tests/fixtures,support/openapi,.idea,.vscode,docker-volume,ffmpeg-3,ffmpeg-4 > ./scc.json
60 if: github.event_name != 'pull_request'
62 cat client-build-stats.json
66 if: github.event_name != 'pull_request'
68 STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
69 STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
70 STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }}
71 STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
75 if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
76 echo "Adding ssh key to known hosts"
77 echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
82 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
83 echo "Adding ssh reployement key"
84 ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
87 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
88 echo "Uploading files"
89 scp client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;