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

revert(deploy): keep VM deployment until deprecation #25

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/chore-clean-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
service_account: '${{ vars.GCP_DEPLOYMENTS_SA }}'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1.1.1
uses: google-github-actions/setup-gcloud@v2.1.0

- name: Removing CR service
run: |
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/gcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: gcloud

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

env:
PROJECT_ID: ecosystem-infrastructure
GCLOUD_ZONE: us-central1-a

jobs:
build-deploy:
name: Google Cloud Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set project and image names
run: |
BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \
BRANCH_NAME=${BRANCH_NAME,,} && \
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV && \
echo "SHORT_SHA=$(git rev-parse --short=7 $GITHUB_SHA)" >> $GITHUB_ENV

# Setup gcloud CLI
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2.1.2
with:
project_id: ${{ env.PROJECT_ID }}
credentials_json: '${{ secrets.GCLOUD_SA_KEY }}'

- uses: google-github-actions/setup-gcloud@v2.1.0

# Build and push image to Google Container Registry
- name: Build
# Tagging w/ the commit SHA blocks the :latest tag on GCR
run: |
gcloud builds submit ./docker --dir . \
--tag "gcr.io/$PROJECT_ID/$BRANCH_NAME:$SHORT_SHA"
# Deploy image to Compute Engine
- name: Deploy
run: |
gcloud compute instances create-with-container "zfnd-seeder-$SHORT_SHA" \
--zone "$GCLOUD_ZONE" \
--service-account instance-service-account@ecosystem-infrastructure.iam.gserviceaccount.com \
--scopes cloud-platform \
--machine-type n1-highcpu-4 \
--container-image "gcr.io/$PROJECT_ID/$BRANCH_NAME:$SHORT_SHA" \
--tags seeder \
--metadata-from-file startup-script=scripts/seeder-zfnd-org-startup.sh \
--container-mount-host-path mount-path=/etc/dnsseeder,host-path=/etc/dnsseeder,mode=ro
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN git clone --depth 1 --branch v${COREDNS_VERSION} https://github.com/coredns/
WORKDIR /go/src/github.com/coredns/coredns

RUN echo "dnsseed:github.com/zcashfoundation/dnsseeder/dnsseed" >> /go/src/github.com/coredns/coredns/plugin.cfg
# Must be the same replace as in `dnsseeder`. Currently pointing to "main-zfnd" branch
# Must be the same replace as in `dnsseeder`. Currently pointing to "master" branch
RUN echo "replace github.com/btcsuite/btcd => github.com/ZcashFoundation/btcd v0.22.0-beta.0.20220607000607-40dc9492aa42" >> /go/src/github.com/coredns/coredns/go.mod

RUN go get github.com/zcashfoundation/dnsseeder/dnsseed@${DNSSEEDER_VERSION}
Expand Down
Loading