mirror of
https://github.com/ravenscroftj/turbopilot.git
synced 2024-10-01 01:06:01 -04:00
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
tags: ['*']
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
|
|
# Add support for more platforms with QEMU (optional)
|
|
# https://github.com/docker/setup-qemu-action
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Set up Docker BuildX
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
platforms: linux/amd64,linux/arm64,linux/arm68/v8
|
|
|
|
- name: Login to GH ContainerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ravenscroftj
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and push incremental
|
|
uses: docker/build-push-action@v4
|
|
if: (!startsWith(github.ref, 'refs/tags/'))
|
|
with:
|
|
push: true
|
|
tags: ghcr.io/ravenscroftj/turbopilot:latest
|
|
context: ${{github.workspace}}
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
|
- name: Build and push release
|
|
uses: docker/build-push-action@v4
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
push: true
|
|
tags: ghcr.io/ravenscroftj/turbopilot:${{ github.ref_name }}
|
|
context: ${{github.workspace}}
|
|
platforms: linux/amd64,linux/arm64
|
|
|