hexabot/.github/workflows/docker-base.yml

51 lines
1.3 KiB
YAML
Raw Normal View History

2024-12-10 11:06:36 +00:00
name: Build and Push Docker Base Image
2024-09-19 10:25:09 +00:00
2024-09-18 11:25:56 +00:00
on:
push:
2024-12-10 09:56:49 +00:00
branches:
- 'main'
tags:
- 'v*'
2024-09-18 11:25:56 +00:00
jobs:
2024-09-19 10:25:09 +00:00
build-and-push:
2024-09-18 11:25:56 +00:00
runs-on: ubuntu-latest
steps:
2024-09-19 10:25:09 +00:00
- name: Check out repository code
2024-09-18 11:25:56 +00:00
uses: actions/checkout@v4
2024-09-19 10:25:09 +00:00
2024-12-10 09:56:49 +00:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
2024-12-10 11:05:22 +00:00
images: hexastack/hexabot-base
2024-12-10 09:56:49 +00:00
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
2024-09-18 11:25:56 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2024-09-20 16:00:52 +00:00
2024-09-18 11:25:56 +00:00
- name: Login to Docker Hub
2024-12-10 09:56:49 +00:00
if: github.event_name != 'pull_request'
2024-09-19 10:25:09 +00:00
id: docker_login
uses: docker/login-action@v2
2024-09-18 11:25:56 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2024-12-10 09:56:49 +00:00
- name: Build and push Base Docker base image
2024-09-18 11:25:56 +00:00
uses: docker/build-push-action@v6
with:
2024-12-10 09:56:49 +00:00
context: ./api/
file: ./api/Dockerfile.base
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}