mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
chore(ci): use composite action to extract docker variables
This commit is contained in:
45
.github/actions/docker-tags/action.yml
vendored
Normal file
45
.github/actions/docker-tags/action.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: 'docker-tags'
|
||||
description: 'Set Docker default Tag environment variables'
|
||||
# inputs:
|
||||
# outputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
env:
|
||||
BRANCH_NAME_INPUT: ${{ github.event.inputs.branch_name }}
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
BRANCH_NAME="${BRANCH_NAME_INPUT}"
|
||||
else
|
||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
||||
fi
|
||||
|
||||
# Replace / with _ to create a valid tag
|
||||
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||
TAG_PLOT=${TAG}_plot
|
||||
TAG_FREQAI=${TAG}_freqai
|
||||
TAG_FREQAI_RL=${TAG_FREQAI}rl
|
||||
TAG_PI="${TAG}_pi"
|
||||
|
||||
CACHE_TAG_PI=${CACHE_IMAGE}:${TAG_PI}_cache
|
||||
|
||||
echo "GITHUB_REF='${GITHUB_REF}'"
|
||||
echo "BRANCH_NAME='${BRANCH_NAME}'"
|
||||
echo "TAG='${TAG}'"
|
||||
echo "TAG_PLOT='${TAG_PLOT}'"
|
||||
echo "TAG_FREQAI='${TAG_FREQAI}'"
|
||||
echo "TAG_FREQAI_RL='${TAG_FREQAI_RL}'"
|
||||
echo "TAG_PI='${TAG_PI}'"
|
||||
|
||||
echo "BRANCH_NAME=${BRANCH_NAME}" >> "$GITHUB_ENV"
|
||||
echo "TAG=${TAG}" >> "$GITHUB_ENV"
|
||||
echo "TAG_PLOT=${TAG_PLOT}" >> "$GITHUB_ENV"
|
||||
echo "TAG_FREQAI=${TAG_FREQAI}" >> "$GITHUB_ENV"
|
||||
echo "TAG_FREQAI_RL=${TAG_FREQAI_RL}" >> "$GITHUB_ENV"
|
||||
echo "TAG_PI=${TAG_PI}" >> "$GITHUB_ENV"
|
||||
|
||||
echo "CACHE_TAG_PI=${CACHE_TAG_PI}" >> "$GITHUB_ENV"
|
||||
|
||||
|
||||
37
.github/workflows/docker-build.yml
vendored
37
.github/workflows/docker-build.yml
vendored
@@ -42,41 +42,8 @@ jobs:
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Extract branch name
|
||||
env:
|
||||
BRANCH_NAME_INPUT: ${{ github.event.inputs.branch_name }}
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
BRANCH_NAME="${BRANCH_NAME_INPUT}"
|
||||
else
|
||||
BRANCH_NAME="${GITHUB_REF##*/}"
|
||||
fi
|
||||
|
||||
# Replace / with _ to create a valid tag
|
||||
TAG=$(echo "${BRANCH_NAME}" | sed -e "s/\//_/g")
|
||||
TAG_PLOT=${TAG}_plot
|
||||
TAG_FREQAI=${TAG}_freqai
|
||||
TAG_FREQAI_RL=${TAG_FREQAI}rl
|
||||
TAG_PI="${TAG}_pi"
|
||||
|
||||
CACHE_TAG_PI=${CACHE_IMAGE}:${TAG_PI}_cache
|
||||
|
||||
echo "GITHUB_REF='${GITHUB_REF}'"
|
||||
echo "BRANCH_NAME='${BRANCH_NAME}'"
|
||||
echo "TAG='${TAG}'"
|
||||
echo "TAG_PLOT='${TAG_PLOT}'"
|
||||
echo "TAG_FREQAI='${TAG_FREQAI}'"
|
||||
echo "TAG_FREQAI_RL='${TAG_FREQAI_RL}'"
|
||||
echo "TAG_PI='${TAG_PI}'"
|
||||
|
||||
echo "BRANCH_NAME=${BRANCH_NAME}" >> "$GITHUB_ENV"
|
||||
echo "TAG=${TAG}" >> "$GITHUB_ENV"
|
||||
echo "TAG_PLOT=${TAG_PLOT}" >> "$GITHUB_ENV"
|
||||
echo "TAG_FREQAI=${TAG_FREQAI}" >> "$GITHUB_ENV"
|
||||
echo "TAG_FREQAI_RL=${TAG_FREQAI_RL}" >> "$GITHUB_ENV"
|
||||
echo "TAG_PI=${TAG_PI}" >> "$GITHUB_ENV"
|
||||
|
||||
echo "CACHE_TAG_PI=${CACHE_TAG_PI}" >> "$GITHUB_ENV"
|
||||
- name: Set docker tag names
|
||||
uses: ./.github/actions/docker-tags
|
||||
|
||||
- name: Save commit SHA to file
|
||||
# Add commit to docker container
|
||||
|
||||
Reference in New Issue
Block a user