Skip to content

feat: whoops

feat: whoops #62

Workflow file for this run

name: build-testnet
on:
push:
branches:
- main # Triggers only when code is pushed (including merged PRs) to main
merge_group:
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ci-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build-testnet:
runs-on: ubuntu-latest
steps:
- name: "Announce version"
run: echo "Building version for ${{ github.ref_name }}"
- uses: actions/checkout@main
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install npm Packages
run: npm ci
- name: Build
run: npm run build:test
- name: Determine Docker Tag
id: docker_tag
shell: bash
run: |
DOCKER_IMAGE=provenanceio/explorer-frontend
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
echo ::set-output name=branch::${VERSION}
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=testnet-latest
else
VERSION="${VERSION}-${{github.run_number}}"
fi
elif [[ -n "${GITHUB_HEAD_REF}" ]]; then
VERSION=$(echo ${GITHUB_HEAD_REF} | sed -r 's#/+#-#g')
VERSION="${VERSION}-${{github.run_number}}"
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}"
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push testnet Explorer Frontend
uses: docker/build-push-action@v2
with:
file: ./Dockerfile
context: .
push: true
tags: ${{ steps.docker_tag.outputs.TAGS }}