Skip to content

Create and push Docker image of the BlueOS toolchain #5

Create and push Docker image of the BlueOS toolchain

Create and push Docker image of the BlueOS toolchain #5

name: Create and push Docker image of the BlueOS toolchain
on:
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Image Tags
id: tags
run: |
echo "IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/$(echo ${{ github.repository }} | awk -F/ '{print $2}')" >> $GITHUB_ENV
echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "tags=latest,$SHORT_SHA" >> $GITHUB_ENV
echo "Tags set: ${{ env.tags }}"
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.tags }}
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}