fixed dockerfile #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a workflow to build image | |
name: Build Docker Image | |
on: [push, workflow_dispatch] | |
# old: linux/arm/v7, windows/amd64, mac/amd64, mac/arm64 | |
jobs: | |
build: | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to container registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | |
registry: docker.io | |
# So now you can use Actions' own caching! | |
- 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: Build and Push Image | |
uses: docker/build-push-action@v3 | |
with: | |
tags: docker.io/maxatgroundlight/groundlight-multipurpose-img:latest | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
# go here (https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching) | |
# if cache is overflowing and is breaking |