Skip to content

Initial container builds #2

Initial container builds

Initial container builds #2

# A GitHub Action Workflow to build the Azure HOP container image when there are new pushes to the main branch
name: Build Azure Hop Container
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build image locally
run: docker build -t azure-hop .
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Tag latest image
run: docker tag azure-hop ghcr.io/azure-hop/azure-hop-container:latest
- name: Push latest image
run: docker push ghcr.io/azure-hop/azure-hop-container:latest
- name: Tag image with build number
run: docker tag azure-hop ghcr.io/azure-hop/azure-hop-container:${{ github.run_number }}
- name: Push image with build number
run: docker push ghcr.io/azure-hop/azure-hop-container:${{ github.run_number }}