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

CI: initial version Docker build job #87

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-push-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: "Build MSL-API image and push it to registry"

on:
push:
branches:
- 'development'
- 'dev-update-docker'

jobs:
push-image:
if: github.repository == 'utrechtuniversity/msl_api'
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Check out EPOS-MSL catalog repository
uses: actions/checkout@v4
with:
path: epos-msl
repository: UtrechtUniversity/epos-msl
ref: ${{ steps.extract_branch.outputs.branch }}

- name: Authenticate to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: epos-msl/docker/images/msl-api
file: epos-msl/docker/images/msl-api/Dockerfile
push: true
tags: ghcr.io/utrechtuniversity/epos-msl-cat-mslapi:latest