Skip to content

feat: bump rust and taplo versions in Dockerfile #185

feat: bump rust and taplo versions in Dockerfile

feat: bump rust and taplo versions in Dockerfile #185

name: Create and publish a Docker image
on:
push:
branches:
- 'main'
paths:
- docker/**
pull_request:
branches:
- 'main'
paths:
- docker/**
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
image: ["arrow-rust", "arrow-sanitychecks", "arrow-stm32", "arrow-tfenv", "arrow-tenv", "arrow-gis", "arrow-icestorm"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
docker:
- 'docker/${{ matrix.image }}/**'
- name: Dotenv Action
uses: falti/[email protected]
if: steps.changes.outputs.docker == 'true'
id: dotenv
with:
path: docker/${{ matrix.image }}/.env
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: steps.changes.outputs.docker == 'true'
with:
platforms: 'amd64,arm64'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if: steps.changes.outputs.docker == 'true'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: steps.changes.outputs.docker == 'true'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
if: steps.changes.outputs.docker == 'true'
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.image }}
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},value=${{steps.dotenv.outputs.version}}
type=semver,pattern={{major}}.{{minor}},value=${{steps.dotenv.outputs.version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
if: steps.changes.outputs.docker == 'true'
with:
context: docker/${{ matrix.image }}/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64