-
Notifications
You must be signed in to change notification settings - Fork 12
53 lines (45 loc) · 1.43 KB
/
build-sw-container.yml
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
name: Build and Push Docker image
on:
push:
branches: [ 2.x ]
paths:
- '.github/workflows/build-sw-container.yml'
- 'osg-pilot-container/**'
- 'common/**'
repository_dispatch:
types:
- dispatch-build
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: startsWith(github.repository, 'opensciencegrid/')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: make date tag
id: mkdatetag
run: echo "dtag=$(date +%Y%m%d-%H%M)" >> $GITHUB_OUTPUT
- id: format-docker-repo
run: echo "repo-name=osg-htc/osg-pilot-container-probe" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to OSG Harbor
uses: docker/[email protected]
with:
registry: hub.opensciencegrid.org
username: ${{ secrets.OSG_HARBOR_ROBOT_USER }}
password: ${{ secrets.OSG_HARBOR_ROBOT_PASSWORD }}
- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
file: osg-pilot-container/Dockerfile
push: true
tags: "hub.opensciencegrid.org/${{ steps.format-docker-repo.outputs.repo-name }}:${{ steps.mkdatetag.outputs.dtag }}"