Skip to content

Commit

Permalink
add new build-and-deploy initial CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
dennybaa committed Mar 18, 2021
1 parent eaeeb76 commit a9f14f9
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and Deploy

on:
deployment:

# push:
# branches:
# - ci-github-deployments

env:
DEPLOY_APPS: -l name=server -l name=prover -l name=explorer

jobs:
pre:
runs-on: [k8s, stage]
if: github.ref == 'refs/tags/v-test'

steps:
- uses: actions/checkout@v2
- id: print
run: |
echo "::set-output name=shortRev::$(git rev-parse --short HEAD)"
outputs:
shortRev: ${{ steps.print.outputs.shortRev }}

build-images:
name: Build and Push Docker Images
runs-on: [self-hosted, MAIN]
needs: pre

## Required services
# services:
# postgres:
# image: postgres:10.4
# ports:
# - 5432:5432

steps:
- run: echo 'Building image'
# - uses: actions/checkout@v2

# - name: setup-env
# run: |
# echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
# echo CI=1 >> $GITHUB_ENV
# echo $(pwd)/bin >> $GITHUB_PATH
# - name: init
# run: |
# cargo sqlx --version || cargo install --version=0.2.0 sqlx-cli
# zk
# zk run yarn
# cp etc/tokens/{test,localhost}.json
# zk run verify-keys unpack
# zk db basic-setup
# - name: update-images
# run: |
# docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
# zk docker push rust
# zk docker push nginx
# echo IMAGE_TAG=$(git rev-parse --short HEAD) >> $GITHUB_ENV

deploy:
name: Deploy to the Stage enviroment
runs-on: [k8s, deployer, testnet]
needs: build-images

container:
image: dysnix/kubectl:v1.16-gcloud

env:
KUBECONF: ${{ secrets.KUBECONF_TESTNET }}

steps:
-
name: Create ~/.kube/config
run: mkdir -p ~/.kube && echo $KUBECONF | base64 -d > ~/.kube/config
-
name: Clone helm-infra
uses: actions/checkout@v2
with:
repository: matter-labs/helm-infra
path: helm-infra
ref: master
token: ${{ secrets.GH_TOKEN }}
-
name: Deploy apps
run: |
# UPDATE_REPOS=y helmfile -e $HFENV repos
echo helmfile -e $HFENV $DEPLOY_APPS \
list # --args "timeout 180s"
File renamed without changes.
File renamed without changes.

0 comments on commit a9f14f9

Please sign in to comment.