Skip to content

Publish Web App container image to GitHub #21

Publish Web App container image to GitHub

Publish Web App container image to GitHub #21

Workflow file for this run

name: Publish Web App container image to GitHub
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'src/Azure.AISearch.WebApp/**'
permissions:
id-token: write
contents: read
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
#- name: Build Docker Image
# run: docker build --no-cache --build-arg app_version=1.0.$GITHUB_RUN_NUMBER --build-arg source_version=$GITHUB_SHA -t pia/azure-aisearch-webapp:latest -f ./src/Azure.AISearch.WebApp/Dockerfile ./src/Azure.AISearch.WebApp
#- name: Log in to registry
# uses: docker/login-action@v2
# with:
# registry: https://index.docker.io/v1/
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_TOKEN }}
#- name: Push Docker Image to GitHub
# run: |
# #echo "${{ secrets.DOCKER_TOKEN }}" | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# docker tag pia/azure-aisearch-webapp:latest ghcr.io/pia/azure-aisearch-webapp:latest
# docker push ghcr.io/pia/azure-aisearch-webapp:latest
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push agent-service container image to registry
uses: docker/build-push-action@v3
with:
context: ./src/Azure.AISearch.WebApp
push: true
tags: index.docker.io/astrobagel/azure-aisearch-webapp:latest
file: ./src/Azure.AISearch.WebApp/Dockerfile
build-args: |
app_version=1.0.${{ github.run_number }}
source_version=${{ github.sha }}