Merge pull request #120 from Azure-Samples/gk/generative-usecases #31
This file contains 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: Frontend Build and Push to GHCR | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'typescript/frontend/**' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set short_sha | |
id: vars | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> ${GITHUB_ENV} | |
- name: Login to GHCR | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: downcase env.REPOSITORY | |
run: | | |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: typescript/frontend | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/frontend-service:${{ env.short_sha }} |