Skip to content

change docker image name #25

change docker image name

change docker image name #25

Workflow file for this run

name: Build
on:
push:
branches:
- 'master'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
jobs:
build:
name: Docker images for ghcr.io
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Prover and Verifier
- name: Prover&Verifier image tags & labels
id: meta-all
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}
- name: Prover&Verifier image build & push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-all.outputs.tags }}
labels: ${{ steps.meta-all.coutputs.labels }}
# Prover
- name: Prover image tags & labels
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-prover
- name: Prover image build & push
uses: docker/build-push-action@v3
with:
context: .
file: air_prover/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.coutputs.labels }}
# Verifier
- name: Verifier image tags & labels
id: meta-ver
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-verifier
- name: Verifier image build & push
uses: docker/build-push-action@v3
with:
context: .
file: air_verifier/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-ver.outputs.tags }}
labels: ${{ steps.meta-ver.coutputs.labels }}
#Release files
- name: Extract binary from Docker image
run: |
container_id=$(docker create ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}:pr-3)
docker cp $container_id:/usr/bin/cpu_air_prover .
docker cp $container_id:/usr/bin/cpu_air_verifier .
docker rm $container_id
- name: Verify file existence#1
run: pwd
- name: Verify file existence#2
run: ls -l
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
file_glob: true
overwrite: true
tag: ${{ github.ref }}
file: /home/runner/work/stone-packaging/stone-packaging/cpu_air*
repo_token: ${{ secrets.GITHUB_TOKEN }}