chore: fix dependabot prefixes #34
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: 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/[email protected] | |
with: | |
registry: ${{ env.GH_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata for container | |
id: gcr | |
uses: docker/[email protected] | |
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/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.gcr.outputs.tags }} | |
labels: ${{ steps.gcr.outputs.labels }} |