2023-08-24 12:36:37 +02:00
|
|
|
name: docker
|
|
|
|
|
|
|
|
on:
|
2024-02-08 11:30:38 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
default: latest
|
|
|
|
type: string
|
2023-08-24 12:36:37 +02:00
|
|
|
workflow_call:
|
2024-01-30 14:28:34 +01:00
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
default: latest
|
|
|
|
type: string
|
2023-08-24 12:36:37 +02:00
|
|
|
|
|
|
|
jobs:
|
2024-01-30 14:28:34 +01:00
|
|
|
push_to_dockerhub:
|
2023-08-24 12:36:37 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-01-30 14:28:34 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
2023-08-24 12:36:37 +02:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-30 14:28:34 +01:00
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v4
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
|
|
|
|
2023-08-24 12:36:37 +02:00
|
|
|
- name: Build and push
|
2024-01-30 14:28:34 +01:00
|
|
|
uses: docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
tags: ${{ secrets.DOCKER_USERNAME }}/lnbits:${{ inputs.tag }}
|
2024-02-08 11:30:38 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2024-01-30 14:28:34 +01:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
|
|
|
|
- name: Build and push latest tag
|
|
|
|
uses: docker/build-push-action@v5
|
2023-08-24 12:36:37 +02:00
|
|
|
with:
|
|
|
|
context: .
|
2024-01-30 14:28:34 +01:00
|
|
|
push: true
|
|
|
|
tags: ${{ secrets.DOCKER_USERNAME }}/lnbits:latest
|
2024-02-08 11:30:38 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2024-01-30 14:28:34 +01:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|