Skip to content

Change starknet sepolia node. #42

Change starknet sepolia node.

Change starknet sepolia node. #42

Workflow file for this run

name: API
on:
push:
branches: [ main, dev ]
paths:
- 'TrainStation/**'
- '.github/workflows/station.yml'
pull_request:
branches: [ main, dev ]
paths:
- 'TrainStation/**'
- '.github/workflows/station.yml'
release:
types: [published, created]
env:
DOCKER_IMAGE: trainprotocol/station
DOTNET_VERSION: 9
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Format version
id: format_version
run: |
commitHash=${GITHUB_SHA:0:7}
ts=$(date +%s)
version=$commitHash-$ts
echo "VERSION=$version" >> $GITHUB_ENV
- name: Sanitize branch name
id: sanitize_branch_name
run: |
sanitized_ref_name=$(echo "${GITHUB_REF_NAME}" | sed 's/[\/.]/-/g')
echo "SANITIZED_REF_NAME=$sanitized_ref_name" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: TrainStation/Dockerfile
push: ${{github.ref_name == 'main' || github.ref_name == 'dev'}}
build-args: |
DOTNET_VERSION=${{ env.DOTNET_VERSION }}
tags: |
${{ env.DOCKER_IMAGE }}:${{ env.SANITIZED_REF_NAME }}-${{ env.VERSION }}
${{ env.DOCKER_IMAGE }}:${{ env.SANITIZED_REF_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max