diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d4070fed..449436a0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,34 +39,3 @@ jobs: tags: gcr.io/radicle-services/radicle-httpd:latest,gcr.io/radicle-services/radicle-httpd:${{ github.sha }} cache-from: type=registry,ref=gcr.io/radicle-services/radicle-httpd:latest cache-to: type=inline - - deploy-seed-node: - runs-on: ubuntu-latest - needs: build-and-push-images - permissions: - contents: 'read' - id-token: 'write' - strategy: - matrix: - host: [seed] - include: - - host: seed - zone: europe-west4-c - steps: - - id: 'auth' - uses: 'google-github-actions/auth@v0' - with: - workload_identity_provider: 'projects/281042598092/locations/global/workloadIdentityPools/github-actions/providers/google-cloud' - service_account: 'github-actions@radicle-services.iam.gserviceaccount.com' - - name: Fetch host .env file - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="curl https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.env.${{ matrix.host }} >.env" - - name: Fetch docker-compose.yml - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="curl https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/docker-compose.yml >docker-compose.yml" - - name: Make room for new images - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="docker system prune --all --force" - - name: Pull container images - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="RADICLE_IMAGE_TAG=${{ github.sha }} docker-compose --file docker-compose.yml pull" - - name: Stop services - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="RADICLE_IMAGE_TAG=${{ github.sha }} docker-compose --file docker-compose.yml down" - - name: Restart services - run: gcloud beta compute ssh --zone ${{ matrix.zone }} "github-actions@alt-clients-${{ matrix.host }}" --project "radicle-services" --command="RADICLE_IMAGE_TAG=${{ github.sha }} docker-compose --file docker-compose.yml up --detach" diff --git a/docker-compose.yml b/docker-compose.yml index db7ed3e5..79e26b47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,6 @@ services: RUST_LOG: debug RAD_PASSPHRASE: seed RUST_BACKTRACE: 1 - GIT_TRACE: 1 - GIT_TRACE_PACKET: 1 volumes: - /mnt/radicle/heartwood:/root/ init: true diff --git a/scripts/deploy-seed b/scripts/deploy-seed new file mode 100755 index 00000000..083f7b90 --- /dev/null +++ b/scripts/deploy-seed @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +HOST=seed.radicle.xyz +BRANCH="$(git rev-parse --abbrev-ref HEAD)" +HEAD="$(git rev-parse HEAD)" + +if [ "$BRANCH" != "master" ]; then + echo "You must be on the master branch to run this script." + exit 1 +fi + +echo "Using commit $HEAD" +echo "Copying files.." +scp .env.seed root@"$HOST":.env +scp docker-compose.yml root@"$HOST":docker-compose.yml + +echo "Deploying.." +ssh root@$HOST << EOF + docker system prune --all --force + RADICLE_IMAGE_TAG=$HEAD docker-compose --file docker-compose.yml pull + RADICLE_IMAGE_TAG=$HEAD docker-compose --file docker-compose.yml down + RADICLE_IMAGE_TAG=$HEAD docker-compose --file docker-compose.yml up --detach +EOF