Skip to content

refactor: remove sponsor banner related settings and UI components, c… #24

refactor: remove sponsor banner related settings and UI components, c…

refactor: remove sponsor banner related settings and UI components, c… #24

Workflow file for this run

name: Build and push Docker image
on:
push:
tags:
- "v*"
pull_request:
types:
- closed
branches:
- main
jobs:
build:
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Extract version from package.json
id: version
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
- name: Compute Docker tags
id: tags
run: |
BASE_IMAGE="iconical/swush"
VERSION="${{ steps.version.outputs.version }}"
TAGS="$BASE_IMAGE:$VERSION,$BASE_IMAGE:latest"
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
if [[ "$MAJOR" == "1" && "$MINOR" != "0" && "$PATCH" == "0" ]]; then
TAGS="$TAGS,$BASE_IMAGE:stable"
fi
echo "docker_tags=$TAGS" >> "$GITHUB_OUTPUT"
- name: Login to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
- name: Build and push Docker image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.tags.outputs.docker_tags }}