-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Run on push to main and workflow_dispatch (#3)
* Allow for PRs to run build tests but don't deploy unless on main. If need to delploy on a non-main branch then use workflow_dispatch.
- Loading branch information
1 parent
2b1e097
commit ba4d986
Showing
1 changed file
with
23 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
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 | ||
|
@@ -21,7 +27,7 @@ jobs: | |
# list of Docker images to use as base name for tags | ||
images: | | ||
sslhep/analysis-dask-uc | ||
hub.opensciencegrid.org/usatlas/analysis-dask-uc | ||
hub.opensciencegrid.org/usatlas/analysis-dask-uc | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=ref,event=branch | ||
|
@@ -36,25 +42,38 @@ jobs: | |
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 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
|