Skip to content

Commit

Permalink
Add quickstart builder action (#558)
Browse files Browse the repository at this point in the history
add quickstart builder action
  • Loading branch information
paulgb authored Jan 18, 2024
1 parent 9a5f75a commit 697d0a3
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-quickstart-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Quickstart Docker Image

on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
paths-ignore: [ "/docs" ]

pull_request:
branches: [ "main" ]
paths:
# Unless the Dockerfile itself has changed, testing whether a build passes
# on a PR doesn’t tell us much that faster CI/CD workflows don’t already.
- '.github/workflows/build-quickstart-image.yml'
- 'docker/quickstart/*'

env:
IMAGE_NAME: plane/quickstart

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: 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: "."
file: "docker/quickstart/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
project: 58j0517pw2

0 comments on commit 697d0a3

Please sign in to comment.