Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new GitHub action that syncs with Radicle #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Radicle Sync

# Controls when the workflow will run
on:
push:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:

- name: Install radicle-cli
run: |
curl https://europe-west6-apt.pkg.dev/doc/repo-signing-key.gpg | sudo apt-key add -
echo deb https://europe-west6-apt.pkg.dev/projects/radicle-services radicle-cli main | sudo tee -a /etc/apt/sources.list.d/radicle-registry.list
sudo apt update
sudo apt install radicle-cli
rad --version
rad auth --help

- name: Setup Radicle Identity
run: |
mkdir -p $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys
echo ${{ secrets.RADICLE_IDENTITY_PRIVATE_KEY }} | base64 --decode > $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys/librad.key
rad auth --passphrase ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }}

- name: Clone from Radicle
run: |
rad clone ${{ secrets.RADICLE_PROJECT_ID }} --no-confirm
cd ${{ secrets.RADICLE_PROJECT_NAME }}

- name: Fetch code from GitHub
run: |
export GH_REPO_URL=$( echo ${{ github.repositoryUrl }} \
| sed -e 's/git:\/\//git@/g' \
| sed -e 's/github.com\//github.com:/g')

git remote add github ${GH_REPO_URL}
git checkout -B ${{ github.ref }} --track github/${{ github.ref }}

- name: Push to Radicle Network
run: |
rad push