Skip to content

refactor: remove unused import #16

refactor: remove unused import

refactor: remove unused import #16

---
name: Create and publish a container
on:
push:
branches:
- main
workflow_dispatch: {}
env:
GH_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
packages: write
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the gcr registry
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for container
id: gcr
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{ branch}}-{{date 'YYYYMMDDHHmmss'}}
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push container image
uses: docker/build-push-action@v6.7.0
with:
context: .
push: true
tags: ${{ steps.gcr.outputs.tags }}
labels: ${{ steps.gcr.outputs.labels }}