-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 3.02 KB
/
CI_push.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build on push
on:
push:
branches:
- "*"
tags:
- "v*.*.*"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Docker meta
id: meta
uses: docker/[email protected]
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
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Harbor Container Registry
uses: docker/[email protected]
with:
registry: hub.opensciencegrid.org
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: Test build
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
uses: docker/[email protected]
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# we could use the code commented bellow to update AF frontend to add/change images selectable.
# - 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]>