Skip to content

Commit

Permalink
👷✨ Add docker hub publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo-Barreto committed Dec 31, 2024
1 parent 7a4c2eb commit ac56843
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,11 @@ jobs:
- 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
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
images: ${{ steps.get_image_name.outputs.name }}
tags: |
type=ref,event=branch
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -45,6 +29,16 @@ jobs:
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:
Expand Down

0 comments on commit ac56843

Please sign in to comment.