CI: add basic image build jobs #1
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
--- | |
name: "Build Nginx image and push it to registry" | |
on: | |
push: | |
branches: | |
- 'development' | |
- 'dev-update-docker' | |
paths: | |
- '.github/workflows/build-push-image-nginx.yml' | |
- 'docker/images/nginx/**' | |
jobs: | |
push-image: | |
if: github.repository == 'utrechtuniversity/epos-msl' | |
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: 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: docker/images/nginx | |
file: docker/images/nginx/Dockerfile | |
push: true | |
tags: latest |