Skip to content

Merge pull request #32 from alkem-io/travis #24

Merge pull request #32 from alkem-io/travis

Merge pull request #32 from alkem-io/travis #24

name: Build & Deploy to Dev
on:
push:
branches: [develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@master
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
- name: 'Login into DockerHub'
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Build & Push image'
run: |
docker build -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-matrix-adapter:${{ github.sha }} -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-matrix-adapter:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-matrix-adapter:${{ github.sha }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@master
- uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CRED_K8S_NEW }}
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP_K8S }}
- uses: Azure/k8s-create-secret@v1
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: alkemio-matrix-adapter-secret
- uses: azure/setup-kubectl@v3
with:
version: "v1.22.0" # default is latest stable, fixing it to a compatible version
id: install
- uses: Azure/k8s-deploy@v1
with:
manifests: |
manifests/25-matrix-adapter-deployment-dev.yaml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/alkemio-matrix-adapter:${{ github.sha }}
imagepullsecrets: |
alkemio-matrix-adapter-secret