Skip to content

Support for services with custom ids #11

Support for services with custom ids

Support for services with custom ids #11

name: Build and Push
on: [push]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: root
password: ${{ secrets.GITHUB_TOKEN }}
- name: extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: build and push image to registry
uses: docker/build-push-action@v3
with:
file: Dockerfile
context: .
cache-from: type=gha
pull: true
push: true
tags: ${{ steps.meta.outputs.tags }}