Skip to content

chore: add Docker image and publish to DockerHub #1

chore: add Docker image and publish to DockerHub

chore: add Docker image and publish to DockerHub #1

on:
push:
branches:
- main
jobs:
build_and_publish_docker_image:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Docker image tags
id: image_tags
run: |
IMAGE=italia/publiccode-issueopener
TAGS=${IMAGE}:latest
TAGS="$TAGS,${IMAGE}:${GITHUB_SHA::8}"
echo ::set-output name=tags::${TAGS}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.image_tags.outputs.tags }}