Skip to content

correct naming

correct naming #3

name: Build and push images
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME_PREFIX: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build base image
run: docker-compose build base
- name: tag base image
run: docker tag mfem-base ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/base:latest
- name: push base image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/base:latest
- name: build cpu image
run: docker-compose build cpu ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cpu:latest .
- name: tag cpu image
run: docker tag mfem-cpu ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cpu:latest
- name: push cpu image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cpu:latest