mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 22:27:22 +00:00
always build on main and tags and PRs
This commit is contained in:
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@@ -7,16 +7,11 @@ on:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
env:
|
||||
REGISTRY: ghcr.io/fleetbase
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and Start Docker Services
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
@@ -27,34 +22,8 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
# this will be replaced by docker buildx bake with an empty line
|
||||
# to get just tags without the image name
|
||||
images: |
|
||||
willbereplaced
|
||||
tags: |
|
||||
type=edge,branch=main
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Build and release
|
||||
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && success()
|
||||
env:
|
||||
# get tags from the json object and pass as a string-encoded list
|
||||
tags: "${{ toJSON(fromJSON(steps.meta.outputs.json).tags) }}"
|
||||
uses: docker/bake-action@v2
|
||||
with:
|
||||
push: true
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
|
||||
Reference in New Issue
Block a user