Skip to content

Commit

Permalink
Create docker-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocastignoli authored Aug 1, 2024
1 parent acb9a11 commit 43958b6
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker

on:
push:
branches: [ "master" ]

env:
NAMESPACE: ghcr.io/ethereum/sourcify
IMAGE_NAME: ${{ env.NAMESPACE }}/stats-gen
GITHUB_CR_PAT: ${{ secrets.CR_PAT }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log into registry ${{ env.NAMESPACE }}
run: echo ${{ env.GITHUB_CR_PAT }} | docker login ghcr.io --username kuzdogan --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 43958b6

Please sign in to comment.