| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- name: Build Docker image
- on:
- on: workflow_dispatch
- release:
- types:
- - created
- env:
- DOCKER_IMAGE: archivebox-ci
- jobs:
- buildx:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- with:
- submodules: true
- fetch-depth: 1
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v1
- with:
- version: latest
- install: true
-
- - name: Builder instance name
- run: echo ${{ steps.buildx.outputs.name }}
-
- - name: Available platforms
- run: echo ${{ steps.buildx.outputs.platforms }}
-
- - name: Cache Docker layers
- uses: actions/cache@v2
- with:
- path: /tmp/.buildx-cache
- key: ${{ runner.os }}-buildx-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-buildx-
- - name: Docker Login
- uses: docker/login-action@v1
- if: github.event_name != 'pull_request'
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Collect Docker tags
- id: docker_meta
- uses: crazy-max/ghaction-docker-meta@v1
- with:
- images: archivebox/archivebox,nikisweeting/archivebox
- tag-sha: true
- tag-semver: |
- {{version}}
- {{major}}.{{minor}}
-
- - name: Build and push
- id: docker_build
- uses: docker/build-push-action@v2
- with:
- context: ./
- file: ./Dockerfile
- builder: ${{ steps.buildx.outputs.name }}
- push: ${{ github.event_name != 'pull_request' }}
- tags: ${{ steps.docker_meta.outputs.tags }}
- cache-from: type=local,src=/tmp/.buildx-cache
- cache-to: type=local,dest=/tmp/.buildx-cache
- platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
- - name: Image digest
- run: echo ${{ steps.docker_build.outputs.digest }}
|