Updates for v3.2.2 #1059
Workflow file for this run
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: Publish | |
on: | |
push: | |
branches: | |
- develop | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
docker_tag: | |
description: 'Tag suffix; will be used as seedplatform/seed:{docker_tag}' | |
required: true | |
jobs: | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
# using `v2` in key to clear old cache due to errors | |
# See: https://stackoverflow.com/questions/63521430/clear-cache-in-github-actions | |
key: ${{ runner.os }}-buildx-v2-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx-v2- | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Parse tag | |
id: parse_tag | |
run: | | |
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}" | |
echo "GITHUB_REF: ${GITHUB_REF}" | |
if [[ ${GITHUB_EVENT_NAME} == "push" ]]; then | |
if [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then | |
SEED_TAG=seedplatform/seed:develop | |
elif [[ "${GITHUB_REF}" =~ "refs/tags/v" ]]; then | |
# you can have multiple tags, separated by commas | |
SEED_TAG=seedplatform/seed:${GITHUB_REF#refs/tags/v},seedplatform/seed:latest | |
else | |
echo "Unhandled GITHUB_REF (this shouldn't happen), exiting" | |
exit 1 | |
fi | |
elif [[ ${GITHUB_EVENT_NAME} == "workflow_dispatch" ]]; then | |
SEED_TAG=seedplatform/seed:${{ github.event.inputs.docker_tag }} | |
else | |
echo "Unhandled event type (this shouldn't happen), exiting" | |
exit 1 | |
fi | |
echo "seed_tags=${SEED_TAG}" >> $GITHUB_OUTPUT | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.parse_tag.outputs.seed_tags }} |