|
|
|
@ -10,7 +10,7 @@ on:
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
build:
|
|
|
|
runs-on: self-hosted
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
@ -21,6 +21,12 @@ 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
|
|
|
|
@ -38,5 +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 \
|
|
|
|
|
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Update deployment file
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
method: kubeconfig
|
|
|
|
|
|
|
|
kubeconfig: ${{ secrets.KUBE_CONFIG }}
|
|
|
|
|
|
|
|
id: setcontext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Deploy to Kubernetes
|
|
|
|
|
|
|
|
run: kubectl apply -f $GITHUB_WORKSPACE/deployment.yml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Verify deployment
|
|
|
|
|
|
|
|
run: kubectl rollout status deployment/snowflake-server
|
|
|
|
|