Skip to content

build

build #85

Workflow file for this run

name: build
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- 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-
- name: Build Docker image
uses: docker/build-push-action@v3
with:
context: .
file: build-scripts/Dockerfile.ci
load: true
tags: ci_image:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Extract artifact from Docker image
run: |
docker create --name extract_artifact ci_image:latest
docker cp extract_artifact:/lamassu/lamassu-machine/build/codebase/update.tar ./update.tar
docker rm extract_artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: update.tar
path: update.tar
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache