Skip to content

Merge branch 'main' of github.com:DIPSAS/hello-open-dips #79

Merge branch 'main' of github.com:DIPSAS/hello-open-dips

Merge branch 'main' of github.com:DIPSAS/hello-open-dips #79

name: CI/CD Pipeline
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker image
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az acr login --name ${{ secrets.ACR_NAME }}
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/hello-bff:latest .
docker push ${{ secrets.ACR_LOGIN_SERVER }}/hello-bff:latest
- name: Azure CLI script
uses: azure/CLI@v1
with:
inlineScript: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az webapp config container set --name ${{ secrets.WEBAPP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --docker-custom-image-name ${{ secrets.ACR_LOGIN_SERVER }}/hello-bff:latest
az webapp restart --name ${{ secrets.WEBAPP_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --verbose