Skip to content

stream changes (#473) #286

stream changes (#473)

stream changes (#473) #286

name: Build Controller Image
on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
paths-ignore: [ "/docs" ]
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/build-controller-image.yml'
env:
IMAGE_NAME: plane/controller
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Depot
uses: depot/setup-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short
type=semver,pattern={{version}}
type=raw,value=latest
- name: Build and push Docker image
id: build-and-push
uses: depot/build-push-action@v1
with:
context: "."
build-args: |
SCCACHE_BUCKET=${{ secrets.PLANE_SCCACHE_BUCKET }}
AWS_ACCESS_KEY_ID=${{ secrets.PLANE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY=${{ secrets.PLANE_AWS_SECRET_ACCESS_KEY }}
AWS_REGION=us-east-1
file: "controller/Dockerfile"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'drifting-in-space/plane' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
buildx-fallback: true