working version #71
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: Build AnalysisBase ML image | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
repository_dispatch: | |
types: gitops-analysis-base-trigger | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
sslhep/analysis-dask-uc | |
hub.opensciencegrid.org/usatlas/analysis-dask-uc | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=sha, | |
type=raw,value=latest | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to Harbor Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: hub.opensciencegrid.org | |
username: ${{ secrets.HARBOR_USERNAME }} | |
password: ${{ secrets.HARBOR_PASSWORD }} | |
- name: Test build | |
if: github.event_name == 'pull_request' | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: Dockerfile | |
load: true | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and push | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# - name: Repository Dispatch | |
# uses: peter-evans/[email protected] | |
# with: | |
# token: ${{ secrets.GITOPS_REBUILD_TRIGGER }} | |
# repository: analysis-dask/usatlas | |
# event-type: gitops-analysis-base-trigger | |
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' | |
# - name: Update Version In Checked-Out Code | |
# if: ${{ github.event.client_payload.sha }} | |
# run: | | |
# sed -i "s@\(.*image:\).*@\1 docker.io/sandci/alarms_and_alerts:${{ github.event.client_payload.sha }}@" ${GITHUB_WORKSPACE}/atlas-analytics/crons/perfsonar/*.yaml | |
# - name: Commit The New Image Reference | |
# uses: stefanzweifel/[email protected] | |
# if: ${{ github.event.client_payload.sha }} | |
# with: | |
# commit_message: Deploy new AAAS PerfSONAR image ${{ github.event.client_payload.sha }} | |
# branch: main | |
# commit_options: "--no-verify --signoff" | |
# repository: . | |
# commit_user_name: AAAS GitOps Bot | |
# commit_user_email: [email protected] | |
# commit_author: AAAS GitOps Bot <[email protected]> |