testing-vars #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: testing-vars | |
run-name: "testing-vars" | |
env: | |
APPLICATION: "erigon" | |
BUILDER_IMAGE: "golang:1.22-bookworm" | |
TARGET_BASE_IMAGE: "alpine:3.20.1" | |
APP_REPO: "erigontech/erigon" | |
CHECKOUT_REF: "main" | |
DOCKER_URL: "erigontech/dev22-erigon" | |
DOCKERHUB_REPOSITORY: "erigontech/dev-erigon" | |
LABEL_DESCRIPTION: "[docker image built on a last commit id from the main branch] Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency frontier. Archive Node by default." | |
on: | |
push: | |
branches: | |
- 'main' | |
#tags: | |
## only trigger on release tags: | |
#- 'v*.*.*' | |
#- 'v*.*.*-*' | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- name: Check Dockerhub | |
run: | | |
curl_cmd="curl -s -H \"Authorization: JWT ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}\" " | |
url1='https://hub.docker.com/v2/namespaces/erigontech/repositories/erigon' | |
max_pages=100 | |
my_list () { | |
next_page="$url1/tags?page=1&page_size=100" | |
while [ "$next_page" != "null" ] | |
do | |
# Print tags and push dates for tags matching "main-": | |
$curl_cmd $next_page | jq -r '.results|.[]|.name + " " + .tag_last_pushed' | grep 'main-' | |
next_page=`$curl_cmd $next_page | jq '.next' | sed -e 's/^\"//' -e 's/\"$//'` | |
done | |
} | |
my_list | tail -n+$max_pages | while read line; do | |
echo -n "Removing docker image: $line " | |
echo -n "sh cli remove $(echo $line | sed -e 's/^\(main-.\{7\}\) .*/\1/' ) ." | |
echo "... Done." | |
done | |
- name: Debug current directory | |
env: | |
DOCKER_PUBLISH_LATEST_CONDITION: ${{ 'true' == 'true' && format('--tag {0}:latest',env.DOCKER_URL) || 'nothing' }} | |
run: | | |
echo "github.ref= ${{ github.ref_name }}" | |
set | |
pwd | |
ls -l | |
ls -lao .. |