Skip to content

Improvements to run using published container image #36

Improvements to run using published container image

Improvements to run using published container image #36

---
name: build_container
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
pull_request:
push:
tag:
- '*'
jobs:
build_container:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: login to ghcr.io
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: extract metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=ref,event=pr
type=ref,event=branch
- name: build container
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}