Skip to content

👷 Add initial CI

👷 Add initial CI #1

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: Get image name
id: get_image_name
shell: bash
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}
# Change all uppercase to lowercase
IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]')
echo "name=$IMAGE_NAME" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ steps.get_image_name.outputs.name }}
tags: |
type=ref,event=branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- 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