Skip to content

Commit

Permalink
refactor workflow to use hub.docker registry
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeckiJ committed Oct 21, 2024
1 parent 9b1dbd1 commit e6a21d9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 51 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Docker image

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

on:
workflow_dispatch:
inputs:
tags:
description: "Please provide a git tag value, e.g. v1.0-manually-triggered.1"
required: true
type: string
default: "v1.0-manually-triggered.1"
push:
tags:
- "v*"

jobs:
push_to_docker_hub:

name: build push docker image
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildkit env
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: "${{ env.BUILD_CONTEXT }}"
target: ${{ env.BUILD_TARGET_STAGE }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha
51 changes: 0 additions & 51 deletions .github/workflows/publish-image-ghcr.yml

This file was deleted.

0 comments on commit e6a21d9

Please sign in to comment.