Initial container builds #2
Workflow file for this run
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
# 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 }} |