Skip to content

Update staging build-push workflow #1

Update staging build-push workflow

Update staging build-push workflow #1

name: Build and Publish AnvilOps Docker image
on:
push:
branches: [dev]
paths-ignore:
- "infra/**"
- "charts/**"
- "builders/**"
- "docs/**" # The docs are hosted on AnvilOps!
workflow_dispatch:
jobs:
push_to_registry:
name: Push AnvilOps Docker image to Harbor (Staging)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v6
- name: Log in to container registry
run: docker login -u '${{ secrets.DOCKER_USERNAME }}' -p '${{ secrets.DOCKER_PASSWORD }}' registry.anvil.rcac.purdue.edu
- name: Build and push AnvilOps Docker image
run: docker build --push -t registry.anvil.rcac.purdue.edu/anvilops-staging/anvilops:${{ github.run_number }}-${{ github.sha }}${{ github.event_name == 'push' && ' -t registry.anvil.rcac.purdue.edu/anvilops-dev/anvilops:latest' || '' }} --cache-from=type=registry,ref=registry.anvil.rcac.purdue.edu/anvilops-dev/anvilops:latest --cache-to=type=inline .
- name: Log out of container registry
if: always()
run: docker logout registry.anvil.rcac.purdue.edu