2022-02-08 16:50:13 -08:00
|
|
|
name: zcash-params
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-02-10 03:31:33 -08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
2022-02-11 06:05:19 -08:00
|
|
|
paths:
|
2022-03-02 06:23:05 -08:00
|
|
|
# parameter download code
|
2022-02-08 16:50:13 -08:00
|
|
|
- 'zebra-consensus/src/primitives/groth16/params.rs'
|
|
|
|
- 'zebra-consensus/src/chain.rs'
|
|
|
|
- 'zebrad/src/commands/start.rs'
|
2022-03-02 06:23:05 -08:00
|
|
|
# workflow definitions
|
2022-03-02 01:00:55 -08:00
|
|
|
- 'docker/zcash-params/Dockerfile'
|
2022-02-08 16:50:13 -08:00
|
|
|
- '.github/workflows/zcash-params.yml'
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: '1'
|
|
|
|
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
|
|
|
|
GAR_BASE: us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/zebra
|
|
|
|
GCR_BASE: gcr.io/${{ secrets.GCP_PROJECT_ID }}
|
|
|
|
IMAGE_NAME: zcash-params
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build images
|
2022-03-04 11:55:32 -08:00
|
|
|
timeout-minutes: 180
|
2022-02-08 16:50:13 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2.4.0
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: Inject slug/short variables
|
|
|
|
uses: rlespinasse/github-slug-action@v4
|
|
|
|
|
2022-03-03 22:33:29 -08:00
|
|
|
# Automatic tag management and OCI Image Format Specification for labels
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v3.6.2
|
|
|
|
with:
|
|
|
|
# list of Docker images to use as base name for tags
|
|
|
|
images: |
|
|
|
|
${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}
|
|
|
|
# generate Docker tags based on the following events/attributes
|
|
|
|
tags: |
|
|
|
|
type=schedule
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
type=sha
|
|
|
|
|
2022-02-08 16:50:13 -08:00
|
|
|
# Setup gcloud CLI
|
|
|
|
- name: Authenticate to Google Cloud
|
|
|
|
id: auth
|
2022-02-13 04:39:18 -08:00
|
|
|
uses: google-github-actions/auth@v0.6.0
|
2022-02-08 16:50:13 -08:00
|
|
|
with:
|
|
|
|
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
|
|
|
|
|
2022-03-02 16:39:41 -08:00
|
|
|
- name: Set up QEMU
|
|
|
|
id: qemu
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
with:
|
|
|
|
image: tonistiigi/binfmt:latest
|
|
|
|
platforms: all
|
|
|
|
|
2022-02-08 16:50:13 -08:00
|
|
|
# Setup Docker Buildx to allow use of docker cache layers from GH
|
|
|
|
- name: Set up Docker Buildx
|
2022-03-02 16:39:41 -08:00
|
|
|
id: buildx
|
2022-02-08 16:50:13 -08:00
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Login to Google Artifact Registry
|
|
|
|
uses: docker/login-action@v1.12.0
|
|
|
|
with:
|
|
|
|
registry: us-docker.pkg.dev
|
|
|
|
username: _json_key
|
|
|
|
password: ${{ secrets.GOOGLE_CREDENTIALS }}
|
|
|
|
|
|
|
|
# Build and push image to Google Artifact Registry
|
|
|
|
- name: Build & push
|
|
|
|
id: docker_build
|
2022-02-13 04:37:06 -08:00
|
|
|
uses: docker/build-push-action@v2.9.0
|
2022-02-08 16:50:13 -08:00
|
|
|
with:
|
|
|
|
target: builder
|
|
|
|
context: .
|
2022-03-02 01:00:55 -08:00
|
|
|
file: ./docker/zcash-params/Dockerfile
|
2022-03-02 16:39:41 -08:00
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
linux/arm64
|
2022-03-03 22:33:29 -08:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|
2022-02-08 16:50:13 -08:00
|
|
|
build-args: |
|
|
|
|
SHORT_SHA=${{ env.GITHUB_SHA_SHORT }}
|
|
|
|
ZEBRA_SKIP_IPV6_TESTS="1"
|
|
|
|
SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }}
|
|
|
|
push: true
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|