Skip to content

build docker image

build docker image #6

name: build docker image
on:
workflow_dispatch:
schedule:
- cron: '0 14 * * *'
push:
branches:
- main
permissions:
contents: write
packages: write # GHCR への Push に必要
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: true
tags: |
ghcr.io/minecraft-ros2/ros2_java:latest
labels: |
org.opencontainers.image.title=ros2_java
org.opencontainers.image.source=https://github.com/${ github.repository }