Skip to content

Commit

Permalink
Merge pull request #1 from zazuko/ci-docker
Browse files Browse the repository at this point in the history
Build and push Docker image
  • Loading branch information
ludovicm67 authored May 28, 2024
2 parents 9b5a326 + c2fc7a4 commit 0f753fb
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 48 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.git/
.github/
.gitignore
k8s/
node_modules/
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and push Docker image

on:
push:
tags:
- "v*.*.*"
branches:
- main

jobs:
docker:
runs-on: ubuntu-latest

env:
DOCKER_IMAGE: ghcr.io/zazuko/blueprint

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: "${{ env.DOCKER_IMAGE }}"
tags: |
type=ref,event=branch
type=semver,prefix=v,pattern={{version}}
type=semver,prefix=v,pattern={{major}}.{{minor}}
type=semver,prefix=v,pattern={{major}}
type=raw,value=dev-{{branch}}-{{date 'YYYYMMDDHHmmss' tz='UTC'}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker images
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: |
linux/amd64
linux/arm64
48 changes: 0 additions & 48 deletions .gitlab-ci.yml

This file was deleted.

0 comments on commit 0f753fb

Please sign in to comment.