mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 07:25:36 +01:00
Bumps [ASzc/change-string-case-action](https://github.com/ASzc/change-string-case-action) from 2 to 3. - [Release notes](https://github.com/ASzc/change-string-case-action/releases) - [Commits](https://github.com/ASzc/change-string-case-action/compare/v2...v3) --- updated-dependencies: - dependency-name: ASzc/change-string-case-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
name: Build docker image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
|
|
jobs:
|
|
Build-Docker-Image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
with:
|
|
platforms: arm64
|
|
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
|
|
- id: repository_name
|
|
uses: ASzc/change-string-case-action@v3
|
|
with:
|
|
string: ${{ github.repository }}
|
|
|
|
-
|
|
name: Login to ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
-
|
|
name: Build and push
|
|
id: docker_build
|
|
uses: docker/build-push-action@v3
|
|
env:
|
|
IMAGE: ${{ steps.repository_name.outputs.lowercase }}
|
|
with:
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ghcr.io/${{ env.IMAGE }}:latest
|
|
context: .
|
|
file: ./docker/build.dockerfile
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
|
|
# This ugly bit is necessary if you don't want your cache to grow forever
|
|
# until it hits GitHub's limit of 5GB.
|
|
# Temp fix
|
|
# https://github.com/docker/build-push-action/issues/252
|
|
# https://github.com/moby/buildkit/issues/1896
|
|
- name: Move cache
|
|
run: |
|
|
rm -rf /tmp/.buildx-cache
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
-
|
|
name: Invoke deployment hook
|
|
uses: joelwmale/webhook-action@master
|
|
with:
|
|
url: ${{ secrets.WEBHOOK_URL }}
|