This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Needs to be run once only! | |
name: Needs to be run once only! Running again leads to reset | |
on: | |
workflow_dispatch: | |
inputs: | |
GITHUB_REPO: | |
description: 'Repository' | |
default: 'a57y17lte-dev/lineage_builder' | |
required: true | |
RUNNER_TOKEN: | |
description: 'This is the runner token, not PAT' | |
required: true | |
jobs: | |
run-devspace-and-tmux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y tmux | |
# Download and configure 'crave'. | |
- name: Configure the 'crave' environment | |
run: | | |
if [ "${DCDEVSPACE}" == "1" ]; then | |
echo 'No need to set up crave, we are already running in devspace!' | |
else | |
mkdir ${HOME}/bin/ | |
curl -s https://raw.githubusercontent.com/accupara/crave/master/get_crave.sh | bash -s -- | |
mv ${PWD}/crave ${HOME}/bin/ | |
sudo ln -sf /home/${USER}/bin/crave /usr/bin/crave | |
envsubst < ${PWD}/crave.conf.sample >> ${PWD}/crave.conf | |
rm -rf ${PWD}/crave.conf.sample | |
fi | |
env: | |
CRAVE_USERNAME: ${{ secrets.CRAVE_USERNAME }} | |
CRAVE_TOKEN: ${{ secrets.CRAVE_TOKEN }} | |
- name: Run crave devspace | |
run: | | |
crave devspace -- "rm -rf y17ltebuilds ~/actions-runner || true | |
curl https://raw.githubusercontent.com/sounddrill31/Install-GithubActions-Runner/a57y17lte-dev/fetch-latest-zip.sh | bash | |
cd y17ltebuilds | |
if [[ "${{ inputs.RUNNER_TOKEN }}" == "github_pat_*" ]]; then | |
echo "PAT does not work!" | |
else | |
echo "Runner token found" | |
fi | |
cd y17ltebuilds | |
./config.sh --unattended --url "https://github.com/${{ inputs.GITHUB_REPO }}" --token "${{ inputs.RUNNER_TOKEN }}"" |