diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000000..ca9edd8dab --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.oyml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/ci.oyml diff --git a/.github/workflows/promote-stage.yml b/.github/workflows/promote-stage.oyml similarity index 100% rename from .github/workflows/promote-stage.yml rename to .github/workflows/promote-stage.oyml