Skip to content

Update docker_description.yaml #5

Update docker_description.yaml

Update docker_description.yaml #5

name: Publish Docker image
#
# on:
# release:
# types: [published]
#
on:
push:
# Sequence of patterns matched against refs/heads
# branches:
# - main
# Sequence of patterns matched against refs/tags
tags:
- v*.*
env:
REPOSITORY_NAME: "patrickmunne3/custom-agent-openshift"
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Make sure the hook files are executable
run: chmod +x hooks/
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REPOSITORY_NAME }}
- name: echo sha
run: echo ${{ github.ref_name }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REPOSITORY_NAME }}:${{ github.ref_name }}, ${{ env.REPOSITORY_NAME }}:latest
# tags: ${{ github.sha }}
# labels: ${{ github.sha }}