ArchiveBox/.github/workflows/docker.yml

53 lines
1.6 KiB
YAML
Raw Normal View History

2020-11-22 23:41:22 +00:00
name: Docker Push
2020-11-17 15:57:03 +00:00
on:
workflow_dispatch:
push:
jobs:
buildx:
runs-on: ubuntu-latest
steps:
2020-11-22 23:41:22 +00:00
- name: Docker Login
uses: docker/login-action@v1
with:
2020-11-22 23:01:39 +00:00
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
2020-11-22 23:41:22 +00:00
- name: Checkout
2020-11-17 15:57:03 +00:00
uses: actions/checkout@v2
2020-11-22 23:41:22 +00:00
- name: Set up QEMU
2020-11-17 15:57:03 +00:00
uses: docker/setup-qemu-action@v1
2020-11-22 23:41:22 +00:00
- name: Set up Docker Buildx
2020-11-17 15:57:03 +00:00
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
install: true
2020-11-22 23:41:22 +00:00
- name: Builder instance name
2020-11-17 15:57:03 +00:00
run: echo ${{ steps.buildx.outputs.name }}
2020-11-22 23:41:22 +00:00
- name: Available platforms
2020-11-17 15:57:03 +00:00
run: echo ${{ steps.buildx.outputs.platforms }}
2020-11-22 23:41:22 +00:00
- name: Cache Docker layers
2020-11-17 15:57:03 +00:00
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
2020-11-22 23:41:22 +00:00
- name: Build and push
2020-11-17 15:57:03 +00:00
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
2020-11-22 23:01:39 +00:00
${{ secrets.DOCKER_USERNAME }}/archivebox:latest
${{ secrets.DOCKER_USERNAME }}/archivebox:${{ github.sha }}
2020-11-17 15:57:03 +00:00
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/arm64,linux/arm/v7
2020-11-22 23:41:22 +00:00
- name: Image digest
2020-11-17 15:57:03 +00:00
run: echo ${{ steps.docker_build.outputs.digest }}