Update dnsseeder gcloud deployment workflow (#7)

* Try pinning older version of golang
This commit is contained in:
Deirdre Connolly 2021-05-05 22:27:04 -04:00 committed by GitHub
parent 6443615e98
commit b6f5cd01ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1,9 +1,11 @@
name: gcloud
on:
workflow_dispatch:
push:
branches:
- master
- update-gcloud
env:
PROJECT_ID: ecosystem-infrastructure
@ -21,8 +23,8 @@ jobs:
run: |
BRANCH_NAME=$GITHUB_REPOSITORY/$(expr $GITHUB_REF : '.*/\(.*\)') && \
BRANCH_NAME=${BRANCH_NAME,,} && \
echo "::set-env name=BRANCH_NAME::$BRANCH_NAME" && \
echo "::set-env name=SHA7::$(git rev-parse --short=7 $GITHUB_SHA)"
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV && \
echo "SHORT_SHA=$(git rev-parse --short=7 $GITHUB_SHA)" >> $GITHUB_ENV
# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
@ -36,17 +38,17 @@ jobs:
# Tagging w/ the commit SHA blocks the :latest tag on GCR
run: |
gcloud builds submit \
--tag "gcr.io/$PROJECT_ID/$BRANCH_NAME:$SHA7"
--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-$SHA7" \
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:$SHA7" \
--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

View File

@ -1,4 +1,4 @@
FROM golang:alpine as builder
FROM golang:1.14.4-alpine as builder
LABEL maintainer "George Tankersley <george@zfnd.org>"
ENV PATH /go/bin:/usr/local/go/bin:$PATH