Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

v0.1.3

v0.1.3 #28

name: Docker_build_push
on:
release:
types: [created]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
name: Build and push docker image to GitHub Container Registry
strategy:
matrix:
environment: [devnet-1]
runs-on: ubuntu-latest-16-core
environment: ${{ matrix.environment }}
outputs:
tags: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},suffix=${{ format('-{0}', matrix.environment) }}
type=semver,pattern={{major}}.{{minor}},suffix=${{ format('-{0}', matrix.environment) }}
- name: Push to GitHub Container Registry
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_EXECUTOR_SERVICE_ENDPOINT=${{ vars.VITE_EXECUTOR_SERVICE_ENDPOINT }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${{ vars.VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_ERC20_MESSAGING_CONTRACT_ADDRESS=${{ vars.VITE_ERC20_MESSAGING_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS=${{ vars.VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}
VITE_TOPOS_SUBNET_ENDPOINT=${{ vars.VITE_TOPOS_SUBNET_ENDPOINT }}
VITE_TRACING_OTEL_COLLECTOR_ENDPOINT=${{ vars.VITE_TRACING_OTEL_COLLECTOR_ENDPOINT }}
VITE_TRACING_SERVICE_NAME=${{ vars.VITE_TRACING_SERVICE_NAME }}
VITE_TRACING_SERVICE_VERSION=${{ vars.VITE_TRACING_SERVICE_VERSION }}
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.workflow }}
type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-main-${{ github.workflow }}
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:build-cache-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.workflow }},mode=max