Build nightly using github action

This commit is contained in:
Chocobozzz
2021-12-03 10:14:17 +01:00
parent f3fbbf0140
commit 51e9e152f7
10 changed files with 191 additions and 162 deletions
@@ -0,0 +1,46 @@
name: "Reusable deploy on builds.joinpeertube.org"
description: "Reusable deploy on builds.joinpeertube.org"
inputs:
source:
required: true
description: "Source file/files/directory/directories to deploy"
destination:
required: true
description: "Destination directory on builds.joinpeertube.org"
knownHosts:
required: true
description: "Known hosts"
deployKey:
required: true
description: "Deploy key"
deployUser:
required: true
description: "Deploy user"
deployHost:
required: true
description: "Deploy host"
runs:
using: "composite"
steps:
- name: "Deploy"
shell: bash
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "Adding ssh key to known hosts"
echo -e "${{ inputs.knownHosts }}" > ~/.ssh/known_hosts;
eval `ssh-agent -s`
echo "Adding ssh deploy key"
ssh-add <(echo "${{ inputs.deployKey }}");
echo "Uploading files"
scp ${{ inputs.source }} ${{ inputs.deployUser }}@${{ inputs.deployHost }}:../../web/${{ inputs.destination }};
@@ -0,0 +1,31 @@
name: "Reusable prepare PeerTube build"
description: "Reusable prepare PeerTube build"
inputs:
node-version:
required: true
description: 'NodeJS version'
runs:
using: "composite"
steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ inputs.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile
@@ -0,0 +1,16 @@
name: "Reusable prepare PeerTube run"
description: "Reusable prepare PeerTube run"
runs:
using: "composite"
steps:
- name: Setup system dependencies
shell: bash
run: |
sudo apt-get install postgresql-client-common redis-tools parallel
wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
mkdir -p $HOME/bin
cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH
+10 -59
View File
@@ -29,48 +29,15 @@ jobs:
env:
PGUSER: peertube
PGHOST: localhost
NODE_PENDING_JOB_WAIT: 500
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: './.github/actions/reusable-prepare-peertube-build'
with:
node-version: '12.x'
- name: Setup system dependencies
run: |
sudo apt-get install postgresql-client-common redis-tools parallel
wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
mkdir -p $HOME/bin
cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Cache fixtures
uses: actions/cache@v2
with:
path: |
fixtures
key: ${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-${{ hashFiles('fixtures/*') }}
restore-keys: |
${{ runner.OS }}-fixtures-${{ matrix.test_suite }}-
${{ runner.OS }}-fixtures-
${{ runner.OS }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- uses: './.github/actions/reusable-prepare-peertube-run'
- name: Build
run: |
@@ -111,27 +78,11 @@ jobs:
cat benchmark.json build-time.json startup-time.json
- name: Upload benchmark result
env:
STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }}
STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
echo "Adding ssh key to known hosts"
echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
fi
eval `ssh-agent -s`
if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
echo "Adding ssh reployement key"
ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
fi
if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
echo "Uploading files"
scp benchmark.json build-time.json startup-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
fi
uses: './.github/actions/reusable-deploy.yml'
with:
source: benchmark.json build-time.json startup-time.json
destination: peertube-stats
knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
+1 -1
View File
@@ -13,7 +13,7 @@ name: "CodeQL"
on:
push:
branches: [ next ]
branches: [ develop, next ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ next ]
+36
View File
@@ -0,0 +1,36 @@
name: Nightly
on:
push:
branches:
- 'next'
schedule:
- cron: '0 3 * * *'
jobs:
nightly:
runs-on: ubuntu-latest
steps:
-
name: Checkout develop
uses: actions/checkout@v2
with:
ref: next
- uses: './.github/actions/reusable-prepare-peertube-build'
with:
node-version: '14.x'
- name: Build
run: npm run nightly
- uses: './.github/actions/reusable-deploy'
with:
source: ./peertube-nightly-*
destination: nightly-test
knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
+9 -39
View File
@@ -20,24 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: './.github/actions/reusable-prepare-peertube-build'
with:
node-version: '14.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Angular bundlewatch
uses: jackyef/bundlewatch-gh-action@master
with:
@@ -73,27 +59,11 @@ jobs:
- name: Upload stats
if: github.event_name != 'pull_request'
env:
STATS_DEPLOYEMENT_KNOWN_HOSTS: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
STATS_DEPLOYEMENT_KEY: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
STATS_DEPLOYEMENT_USER: ${{ secrets.STATS_DEPLOYEMENT_USER }}
STATS_DEPLOYEMENT_HOST: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
if [ ! -z ${STATS_DEPLOYEMENT_KNOWN_HOSTS+x} ]; then
echo "Adding ssh key to known hosts"
echo -e "${STATS_DEPLOYEMENT_KNOWN_HOSTS}" > ~/.ssh/known_hosts;
fi
eval `ssh-agent -s`
if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
echo "Adding ssh reployement key"
ssh-add <(echo "${STATS_DEPLOYEMENT_KEY}");
fi
if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
echo "Uploading files"
scp lighthouse.json client-build-stats.json scc.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
fi
uses: './.github/actions/reusable-deploy'
with:
source: lighthouse.json client-build-stats.json scc.json
destination: peertube-stats
knownHosts: ${{ secrets.STATS_DEPLOYEMENT_KNOWN_HOSTS }}
deployKey: ${{ secrets.STATS_DEPLOYEMENT_KEY }}
deployUser: ${{ secrets.STATS_DEPLOYEMENT_USER }}
deployHost: ${{ secrets.STATS_DEPLOYEMENT_HOST }}
+2 -23
View File
@@ -50,29 +50,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: './.github/actions/reusable-prepare-peertube-build'
with:
node-version: '12.x'
- name: Setup system dependencies
run: |
sudo apt-get install postgresql-client-common redis-tools parallel
wget --quiet --no-check-certificate "https://download.cpy.re/ffmpeg/ffmpeg-release-4.3.1-64bit-static.tar.xz"
tar xf ffmpeg-release-4.3.1-64bit-static.tar.xz
mkdir -p $HOME/bin
cp ffmpeg-*/{ffmpeg,ffprobe} $HOME/bin
echo "$HOME/bin" >> $GITHUB_PATH
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- uses: './.github/actions/reusable-prepare-peertube-run'
- name: Cache fixtures
uses: actions/cache@v2
@@ -85,9 +67,6 @@ jobs:
${{ runner.OS }}-fixtures-
${{ runner.OS }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Set env test variable (schedule)
if: github.event_name != 'schedule'
run: |