Skip to content

build docker image

build docker image #26

Workflow file for this run

name: build docker image
on:
workflow_dispatch:
schedule:
- cron: '0 14 * * *'
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
repository_dispatch:
types: [dispatches]
permissions:
contents: write
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry (GHCR)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/minecraft-ros2/ros2_java:latest
labels: |
org.opencontainers.image.title=ros2_java
org.opencontainers.image.source=https://github.com/${ github.repository }