9 Commits
Author SHA1 Message Date
Dustin Pianalto f35f07e35a Build for ARM
CI / build (push) Has been cancelled
2021-09-29 22:09:47 -08:00
Dustin Pianalto 207e34e700 Build for ARM
CI / build (push) Has been cancelled
2021-09-29 22:08:06 -08:00
Dustin Pianalto 6adbbb36b2 Build for ARM
CI / build (push) Has been cancelled
2021-09-29 21:54:23 -08:00
Dustin Pianalto 329afdbe81 Merge branch 'main' of github.com:dustinpianalto/snowflake
CI / build (push) Has been cancelled
2021-09-29 21:43:38 -08:00
Dustin Pianalto 13501567c0 Add image secret 2021-09-29 21:42:49 -08:00
Dusty.P ed626a2dad Update main.yml
CI / build (push) Has been cancelled
2021-09-29 20:53:04 -08:00
Dusty.P 761814ec62 Update main.yml
CI / build (push) Has been cancelled
2021-09-29 20:38:40 -08:00
Dusty.P 2b4b2af16c Update main.yml
CI / build (push) Has been cancelled
2021-09-29 20:35:33 -08:00
Dusty.P e825e2bf3c Update workflow
CI / build (push) Has been cancelled
2021-09-29 20:31:38 -08:00
3 changed files with 33 additions and 21 deletions
+28 -21
View File
@@ -11,6 +11,8 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
DOCKER_TARGET_PLATFORM: linux/arm/v7
# Steps represent a sequence of tasks that will be executed as part of the job # Steps represent a sequence of tasks that will be executed as part of the job
steps: steps:
@@ -20,30 +22,35 @@ jobs:
- name: Get Version - name: Get Version
id: get_version id: get_version
uses: battila7/get-version-action@v2.0.0 uses: battila7/get-version-action@v2.0.0
- name: Build container image - name: Docker Login
env: # You may pin to the exact commit or the version.
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }} # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
run: docker build -t registry.digitalocean.com/djpianalto/snowflake-server:$IMAGE_TAG . uses: docker/login-action@v1.10.0
- name: Install doctl
uses: digitalocean/action-doctl@v2
with: with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} registry: ${{ secrets.DR_URL }}
# Username used to log against the Docker registry
username: ${{ secrets.DH_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.DH_PASSWORD }}
# Log out from the Docker registry at the end of a job
logout: true
- name: Login to DigitalOcean Container Registry with short-lived credentials - name: Docker Build & Push
run: doctl registry login --expiry-seconds 600
- name: Push image to DigitalOcean Container Registry
env: env:
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }} IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}
run: docker push registry.digitalocean.com/djpianalto/snowflake-server:$IMAGE_TAG run: |
docker build -t ${{ secrets.DR_URL }}/snowflake-server:$IMAGE_TAG .
docker push ${{ secrets.DR_URL }}/snowflake-server:$IMAGE_TAG
sed -i 's|<IMAGE>|${{ secrets.DR_URL }}/snowflake-server:'${IMAGE_TAG}'|' $GITHUB_WORKSPACE/deployment.yml
- name: Update deployment file - name: Kubernetes set context
run: TAG=${{ steps.get_version.outputs.version-without-v }} && sed -i 's|<IMAGE>|registry.digitalocean.com/djpianalto/snowflake-server:'${TAG}'|' $GITHUB_WORKSPACE/deployment.yml uses: Azure/k8s-set-context@v1.1
with:
- name: Save DigitalOcean kubeconfig with short-lived credentials # Acceptable values: kubeconfig or service-account or service-principal
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 placeholder-chat-dev method: kubeconfig
# Kubernetes Config
- name: Deploy to DigitalOcean Kubernetes kubeconfig: ${{ secrets.KUBE_CONFIG }}
- name: Deploy to Kubernetes
run: kubectl apply -f $GITHUB_WORKSPACE/deployment.yml run: kubectl apply -f $GITHUB_WORKSPACE/deployment.yml
+3
View File
@@ -8,6 +8,9 @@ RUN go mod download
RUN apk update RUN apk update
RUN apk add protobuf RUN apk add protobuf
ENV GOOS=linux
ENV GOARCH=arm
ENV GOARM=7
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
COPY . . COPY . .
+2
View File
@@ -55,3 +55,5 @@ spec:
secretKeyRef: secretKeyRef:
name: snowflake name: snowflake
key: worker_id key: worker_id
imagePullSecrets:
- name: regcred