Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
ci: Deploy built container images
Adam Szkoda committed 3 years ago
commit 3b0d83884646a4840e833eb727b469e84968a4a5
parent ee513ccf7ec9ac813af332d7bc5057fc3c5c1db0
3 files changed +35 -3
added .env.seed
@@ -0,0 +1 @@
+
RADICLE_DOMAIN=seed.radicle.xyz
modified .github/workflows/deploy.yml
@@ -39,3 +39,34 @@ 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"
modified docker-compose.yml
@@ -9,7 +9,7 @@ services:
      RUST_LOG: debug
      RAD_PASSPHRASE: seed
    volumes:
-
      - /var/opt/radicle:/root/.radicle
+
      - /mnt/radicle/heartwood:/root/
    init: true
    container_name: radicle-node
    restart: unless-stopped
@@ -29,7 +29,7 @@ services:
    environment:
      RUST_LOG: debug
    volumes:
-
      - /var/opt/radicle:/root/.radicle
+
      - /mnt/radicle/heartwood:/root/
    init: true
    container_name: radicle-httpd
    restart: unless-stopped
@@ -46,7 +46,7 @@ services:
      - -euc
      - |
        cat <<EOF >/etc/caddy/Caddyfile
-
        {$RADICLE_DOMAIN} {
+
        $RADICLE_DOMAIN {
            reverse_proxy radicle-httpd:8080
        }
        EOF