Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ddd499e58 | ||
|
|
7eb908b3f7 | ||
|
|
bc39045599 | ||
|
|
397c244609 | ||
|
|
eaa4bfc759 | ||
|
|
709e03f9c1 | ||
|
|
f35f07e35a | ||
|
|
207e34e700 | ||
|
|
6adbbb36b2 | ||
|
|
329afdbe81 | ||
|
|
13501567c0 | ||
|
|
ed626a2dad |
@@ -21,11 +21,18 @@ jobs:
|
|||||||
id: get_version
|
id: get_version
|
||||||
uses: battila7/get-version-action@v2.0.0
|
uses: battila7/get-version-action@v2.0.0
|
||||||
|
|
||||||
|
- name: install buildx
|
||||||
|
id: buildx
|
||||||
|
uses: crazy-max/ghaction-docker-buildx@v1
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
- name: Docker Login
|
- name: Docker Login
|
||||||
# You may pin to the exact commit or the version.
|
# You may pin to the exact commit or the version.
|
||||||
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
|
registry: ${{ secrets.DR_URL }}
|
||||||
# Username used to log against the Docker registry
|
# Username used to log against the Docker registry
|
||||||
username: ${{ secrets.DH_USERNAME }}
|
username: ${{ secrets.DH_USERNAME }}
|
||||||
# Password or personal access token used to log against the Docker registry
|
# Password or personal access token used to log against the Docker registry
|
||||||
@@ -37,17 +44,21 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}
|
IMAGE_TAG: ${{ steps.get_version.outputs.version-without-v }}
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${{ secrets.DR_URL }}/snowflake-server:$IMAGE_TAG .
|
docker buildx build --push \
|
||||||
docker push ${{ secrets.DR_URL }}/snowflake-server:$IMAGE_TAG
|
--tag ${{ secrets.DR_URL }}/snowflake-server:$IMAGE_TAG \
|
||||||
sed -i 's|<IMAGE>|${{ secrets.DR_URL }}/snowflake-server:'${IMAGE_TAG}'|' $GITHUB_WORKSPACE/deployment.yml
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||||
|
|
||||||
- name: Kubernetes set context
|
- name: Update deployment file
|
||||||
uses: Azure/k8s-set-context@v1.1
|
run: TAG=${{ steps.get_version.outputs.version-without-v }} && sed -i 's|<IMAGE>|${{ secrets.DR_URL }}/snowflake-server:'${TAG}'|' $GITHUB_WORKSPACE/deployment.yml
|
||||||
|
|
||||||
|
- uses: azure/k8s-set-context@v1
|
||||||
with:
|
with:
|
||||||
# Acceptable values: kubeconfig or service-account or service-principal
|
|
||||||
method: kubeconfig
|
method: kubeconfig
|
||||||
# Kubernetes Config
|
|
||||||
kubeconfig: ${{ secrets.KUBE_CONFIG }}
|
kubeconfig: ${{ secrets.KUBE_CONFIG }}
|
||||||
|
id: setcontext
|
||||||
|
|
||||||
- name: Deploy to Kubernetes
|
- name: Deploy to Kubernetes
|
||||||
run: kubectl apply -f $GITHUB_WORKSPACE/deployment.yml
|
run: kubectl apply -f $GITHUB_WORKSPACE/deployment.yml
|
||||||
|
|
||||||
|
- name: Verify deployment
|
||||||
|
run: kubectl rollout status deployment/snowflake-server
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ COPY ./go.mod .
|
|||||||
COPY ./go.sum .
|
COPY ./go.sum .
|
||||||
|
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
RUN sed -i 's/https/http/' /etc/apk/repositories
|
||||||
RUN apk update
|
RUN apk update
|
||||||
|
|
||||||
RUN apk add protobuf
|
RUN apk add protobuf
|
||||||
|
|||||||
+4
-2
@@ -2,7 +2,7 @@ kind: Service
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: snowflake-server
|
name: snowflake-server
|
||||||
namespace: default
|
namespace: snowflake
|
||||||
labels:
|
labels:
|
||||||
environment: production
|
environment: production
|
||||||
spec:
|
spec:
|
||||||
@@ -25,7 +25,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: snowflake-server
|
name: snowflake-server
|
||||||
namespace: default
|
namespace: snowflake
|
||||||
labels:
|
labels:
|
||||||
app: snowflake-server
|
app: snowflake-server
|
||||||
spec:
|
spec:
|
||||||
@@ -55,3 +55,5 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: snowflake
|
name: snowflake
|
||||||
key: worker_id
|
key: worker_id
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-1
|
||||||
|
|||||||
Reference in New Issue
Block a user