Created
November 24, 2021 15:30
-
-
Save lucamilan/0c62bc097ae1d0a0f69543cf46f94beb to your computer and use it in GitHub Desktop.
Build and Deploy modern applications with Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| deploy: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: βοΈ Checkout git repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
| - name: π§° Setup DotNet 3.1.300 (Tye) | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '3.1.300' | |
| - name: π§° Setup DotNet 6.0.100 (Project) | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '6.0.100' | |
| - name: π οΈ Install Dotnet Tools | |
| run: | | |
| dotnet tool install -g Microsoft.Tye --version "0.10.0-alpha.21420.1" | |
| dotnet tool install -g nbgv --version "3.4.244" | |
| - name: π οΈ Build .NET Solution | |
| run: | | |
| dotnet restore | |
| dotnet build | |
| - name: π Login to Docker Hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: π Push containers to Docker with Tye | |
| run: | | |
| tye push -v Debug | |
| - name: π¨οΈ Generate Kubernetes manifests with Microsoft Tye | |
| run: | | |
| tye generate -v Debug -n lucamilan | |
| cat tye-experiments-generate-production.yaml | |
| - name: π₯ Create Okteto kube.config | |
| if: success() | |
| env: | |
| KUBE_CONFIG: ${{ secrets.OKTETO_KUBE_CONFIG }} | |
| run: | | |
| echo $KUBE_CONFIG | base64 -d > kubeconfig | |
| - name: π₯ Update Kubernetes cluster | |
| if: success() | |
| run: | | |
| kubectl --kubeconfig kubeconfig apply -f kubernetes/redis.yaml,kubernetes/redis-secret.yaml,tye-experiments-generate-production.yaml,kubernetes/ingress.yaml --namespace=lucamilan | |
| kubectl --kubeconfig kubeconfig get pods --namespace=lucamilan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment