Skip to content

web: log register nextUrl #40

web: log register nextUrl

web: log register nextUrl #40

Workflow file for this run

name: Build and Deploy Web Image
on:
push:
paths:
- "web/**"
- ".github/workflows/*"
branches:
- main
- web
env:
GITHUB_REGISTRY: ghcr.io
AZURE_REGISTRY: shodansrs.azurecr.io
GH_IMAGE_NAME: "${{ github.repository }}:${{ github.ref_name }}"
AZ_IMAGE_NAME: "shodan-srs-next:${{ github.ref_name }}"
AZ_IMAGE_SHA: "shodan-srs-next:${{ github.sha }}"
AZURE_WEBAPP_NAME: "shodan-srs-next"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.AZURE_REGISTRY }}
username: github
password: ${{ secrets.AZURE_REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:web"
push: true
tags: |
"${{ env.GITHUB_REGISTRY }}/${{ env.GH_IMAGE_NAME }}"
"${{ env.AZURE_REGISTRY }}/${{ env.AZ_IMAGE_NAME }}"
"${{ env.AZURE_REGISTRY }}/${{ env.AZ_IMAGE_SHA }}"
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: "${{ env.AZURE_REGISTRY }}/${{ env.AZ_IMAGE_SHA }}"