Skip to content

Build Image on New Release #3153

Build Image on New Release

Build Image on New Release #3153

Workflow file for this run

name: Build Image on New Release
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: "Specify the Stride version tag"
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Get Version
run: |
version=${{ github.event.inputs.version || github.ref }}
version=${version#refs/tags/}
echo "version=$version" >> $GITHUB_ENV
echo "Version: $version"
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.version }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up gcloud Cloud SDK environment
uses: google-github-actions/[email protected]
with:
version: "389.0.0"
service_account_key: ${{ secrets.GCP_KEY }}
project_id: ${{ secrets.GCP_NODES_PROJECT }}
export_default_credentials: true
- name: GCloud Configure Docker
run: |
gcloud auth configure-docker gcr.io
- name: Build and Push Image
env:
DOCKER_BUILDKIT: 1
shell: bash
run: |
tag=gcr.io/stride-nodes/core/stride:${{ env.version }}
docker build -t $tag .
docker push $tag