Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding docker build workflow #8

Merged
merged 12 commits into from
May 8, 2024
42 changes: 39 additions & 3 deletions .github/workflows/build_image.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: A dummy workflow to test PR 8
name: Build connectivityserver docker image

on:
schedule:
- cron: "0 5 * * 2"

push:
branches: [ develop ]
tags:
- 'v*'
paths:
- deploy/Dockerfile

workflow_dispatch:

Expand All @@ -10,10 +19,37 @@ jobs:
name: Build Docker image and push to github registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
repository: DUNE-DAQ/daq-docker
path: daq-docker
repository: DUNE-DAQ/connectivityserver
path: connectivityserver

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/DUNE-DAQ/connectivityserver
tags: |
type=raw,value=latest
type=ref,event=branch
type=ref,event=tag

- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: ${{ github.workspace }}/connectivityserver/deploy
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}