Skip to content

Merge pull request #78 from joel-ling/main #1

Merge pull request #78 from joel-ling/main

Merge pull request #78 from joel-ling/main #1

---
name: Build and push Docker image tagged main
on:
push:
branches:
- main
permissions:
contents: read # principle of least privilege
jobs:
build:
name: Build and push Docker image tagged main
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx for multi-platform builds
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ vars.PLATFORMS }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: ${{ vars.PLATFORMS }}
push: true
sbom: true
tags: >-
${{ secrets.DOCKERHUB_ORGANIZATION_NAME }}/${{ vars.IMAGE_NAME }}:main