Skip to content

chore(docker): reduce image size #34

chore(docker): reduce image size

chore(docker): reduce image size #34

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- master
tags: [ 'v*.*.*' ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
# https://github.com/actions/checkout/issues/290#issuecomment-680260080
- name: Extract Docker Info
id: docker
run: |
git fetch --tags --force # Retrieve annotated tags. THIS TRICK REALLY HELPS
# https://github.com/community/community/discussions/4924
# git release do not create annotated tags, so we need use --tags
tag=$(git describe --always --tags --abbrev=8 HEAD)
version=$tag
echo "version=$version" >> $GITHUB_ENV
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker
uses: docker/build-push-action@v6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
file: 'Dockerfile'
platforms: linux/amd64,linux/arm64
context: ./
push: true
tags: |
ghcr.io/jiz4oh/efb:latest
ghcr.io/jiz4oh/efb:${{ env.version }}