Skip to content

Docker image create and publish #19

Docker image create and publish

Docker image create and publish #19

Workflow file for this run

# https://docs.docker.com/build/ci/github-actions/examples/
name: Docker image create and publish
on:
workflow_dispatch:
push:
branches:
- main
env:
DOCKERHUB_REPOSITORY: badstore-docker
DOCKERHUB_TAG: latest
GH_IMAGE_NAME: ${{ github.repository }}
GH_REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DOCKERHUB_REPOSITORY }}:${{ env.DOCKERHUB_TAG }}
${{ env.GH_REGISTRY }}/${{ env.GH_IMAGE_NAME }}:main