From 51e9e152f7df003c65c16f822669a0674efcaf03 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 1 Dec 2021 14:14:58 +0100 Subject: Build nightly using github action --- .github/actions/reusable-deploy/action.yml | 46 ++++++++++++++++++++++ .../reusable-prepare-peertube-build/action.yml | 31 +++++++++++++++ .../reusable-prepare-peertube-run/action.yml | 16 ++++++++ 3 files changed, 93 insertions(+) create mode 100644 .github/actions/reusable-deploy/action.yml create mode 100644 .github/actions/reusable-prepare-peertube-build/action.yml create mode 100644 .github/actions/reusable-prepare-peertube-run/action.yml (limited to '.github/actions') diff --git a/.github/actions/reusable-deploy/action.yml b/.github/actions/reusable-deploy/action.yml new file mode 100644 index 000000000..bc69a2e43 --- /dev/null +++ b/.github/actions/reusable-deploy/action.yml @@ -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 }}; diff --git a/.github/actions/reusable-prepare-peertube-build/action.yml b/.github/actions/reusable-prepare-peertube-build/action.yml new file mode 100644 index 000000000..41ebf71c5 --- /dev/null +++ b/.github/actions/reusable-prepare-peertube-build/action.yml @@ -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 diff --git a/.github/actions/reusable-prepare-peertube-run/action.yml b/.github/actions/reusable-prepare-peertube-run/action.yml new file mode 100644 index 000000000..1a6cd2cfd --- /dev/null +++ b/.github/actions/reusable-prepare-peertube-run/action.yml @@ -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 -- cgit v1.2.3