Skip to content

👷✨ Add docker hub publish #2

👷✨ Add docker hub publish

👷✨ Add docker hub publish #2

Workflow file for this run

name: Build and push with docker
on:
push:
branches:
- "**"
jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
thunderatz/stm32cubemx
ghcr.io/thunderatz/stm32cubemx
tags: |
type=ref,event=branch
- name: Build and push docker image to Github Container Registry
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}
cache-to: type=inline
target: stm32cubemx