feat: Add Docker build
Some checks failed
Build, check & Test / run (push) Failing after 30s
Build Docker Image / build_docker (push) Failing after 1m5s

Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
This commit is contained in:
Florian Bouillon 2023-12-06 11:01:30 +01:00
parent b344bdb849
commit e9ba3c4891

71
.github/workflows/build_docker.yml vendored Normal file
View File

@ -0,0 +1,71 @@
name: Build Docker Image
on:
push:
branches:
- '*'
tags:
- v*
pull_request:
branches:
- master
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
build_docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAME }}
# ghcr.io/${{ env.IMAGE_NAME }}
# git.example.com/${{ env.IMAGE_NAME }}
tags: |
type=edge
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=latest
# - name: Login to a private registry
# uses: docker/login-action@v3
# with:
# registry: git.example.com
# username: ${{ secrets.REGISTRY_USER }}
# password: ${{ secrets.REGISTRY_TOKEN }}
# - name: Login to the Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USER }}
# password: ${{ secrets.DOCKER_TOKEN }}
# - name: Login to the Github Packages
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_PACKAGES_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push the project
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}