Skip to content

Commit

Permalink
Publish to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
malteo committed Jan 7, 2024
1 parent b227e27 commit ccfd3ea
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,40 @@
name: Docker Image CI
name: Create and publish a Docker image

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag bitcoin-fee-notifier:$(date +%s)
- name: Checkout repository
uses: actions/[email protected]

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit ccfd3ea

Please sign in to comment.