diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 0000000..74e277f --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,44 @@ +name: Staging Deployment +on: + push: + branches: + - release/2.35.0 + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - uses: Azure/docker-login@v1 + with: + login-server: sparrowprod.azurecr.io + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - run: | + docker build . -t sparrowprod.azurecr.io/sparrow-proxy:${{ github.run_number }} + docker push sparrowprod.azurecr.io/sparrow-proxy:${{ github.run_number }} + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: richardrigutins/replace-in-files@v1 + with: + files: "./deploymentManifests/deployment.yml" + search-text: '_BUILD__ID_' + replacement-text: '${{ github.run_number }}' + + - uses: azure/setup-kubectl@v2.0 + + - uses: Azure/k8s-set-context@v2 + with: + kubeconfig: ${{ secrets.KUBE_CONFIG }} + + - uses: Azure/k8s-deploy@v4 + with: + action: deploy + namespace: sparrow-staging + manifests: | + ./deploymentManifests/deployment.yml \ No newline at end of file