From 324eda25e0d5fe4ec77a004ae455ba4539afab5a Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 14 Aug 2022 17:27:45 +0200 Subject: [PATCH 1/5] Added support to publish docker image in GHCR --- .github/workflows/docker-image-build.yml | 23 +++++------------------ CHANGELOG.md | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml index f02beff1..aad2fefb 100644 --- a/.github/workflows/docker-image-build.yml +++ b/.github/workflows/docker-image-build.yml @@ -1,4 +1,4 @@ -name: Build docker image +name: Build and publish docker image on: push: @@ -9,20 +9,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - version: latest - - name: Login to docker hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Build the image - run: bash ./scripts/docker/build + uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main + secrets: inherit + with: + build-and-publish-script: bash ./scripts/docker/build diff --git a/CHANGELOG.md b/CHANGELOG.md index f2dd09fe..6034fab1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] +### Added +* [#703](https://github.com/shlinkio/shlink-web-client/issues/703) Added support to publish docker image in GHCR. + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* *Nothing* + + ## [3.7.2] - 2022-08-07 ### Added * [#671](https://github.com/shlinkio/shlink-web-client/issues/671) Added proper color-scheme in root element based on selected theme. From c918eaf903e375aed0abb82178939bee1e547e18 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 14 Aug 2022 17:29:01 +0200 Subject: [PATCH 2/5] Added GHCR publishing in docker build script --- scripts/docker/build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/docker/build b/scripts/docker/build index 1a39c9cb..21dce541 100755 --- a/scripts/docker/build +++ b/scripts/docker/build @@ -8,15 +8,15 @@ DOCKER_IMAGE="shlinkio/shlink-web-client" if [[ "$GITHUB_REF" == *"develop"* ]]; then docker buildx build --push \ --platform ${PLATFORMS} \ - -t ${DOCKER_IMAGE}:latest . + -t ${DOCKER_IMAGE}:latest -t ghcr.io/${DOCKER_IMAGE}:latest . # If ref is not develop, then this is a tag. Build that docker tag and also "stable" else VERSION=${GITHUB_REF#refs/tags/v} - TAGS="-t ${DOCKER_IMAGE}:${VERSION}" + TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ghcr.io/${DOCKER_IMAGE}:${VERSION}" # Push stable tag only if this is not an alpha or beta release - [[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable" + [[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable -t ghcr.io/${DOCKER_IMAGE}:stable" docker buildx build --push \ --build-arg VERSION=${VERSION} \ From a2440d318034d23d2760573d4e61aeedd753ca01 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 19 Aug 2022 12:48:17 +0200 Subject: [PATCH 3/5] Moved to docker build from reusable workflow --- .github/workflows/docker-image-build.yml | 3 ++- scripts/docker/build | 25 ------------------------ 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100755 scripts/docker/build diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml index aad2fefb..d850fa57 100644 --- a/.github/workflows/docker-image-build.yml +++ b/.github/workflows/docker-image-build.yml @@ -12,4 +12,5 @@ jobs: uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main secrets: inherit with: - build-and-publish-script: bash ./scripts/docker/build + image-name: shlinkio/shlink-web-client + version-arg-name: VERSION diff --git a/scripts/docker/build b/scripts/docker/build deleted file mode 100755 index 21dce541..00000000 --- a/scripts/docker/build +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -set -ex - -PLATFORMS="linux/arm/v7,linux/arm64/v8,linux/amd64" -DOCKER_IMAGE="shlinkio/shlink-web-client" - -if [[ "$GITHUB_REF" == *"develop"* ]]; then - docker buildx build --push \ - --platform ${PLATFORMS} \ - -t ${DOCKER_IMAGE}:latest -t ghcr.io/${DOCKER_IMAGE}:latest . - -# If ref is not develop, then this is a tag. Build that docker tag and also "stable" -else - VERSION=${GITHUB_REF#refs/tags/v} - TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ghcr.io/${DOCKER_IMAGE}:${VERSION}" - - # Push stable tag only if this is not an alpha or beta release - [[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable -t ghcr.io/${DOCKER_IMAGE}:stable" - - docker buildx build --push \ - --build-arg VERSION=${VERSION} \ - --platform ${PLATFORMS} \ - ${TAGS} . -fi From 4466d733b45e18697c8f81a8c23b5a51cecbaaca Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 13 Sep 2022 15:56:53 +0200 Subject: [PATCH 4/5] Fixed visits not being displayed after a large loading has finished --- src/visits/reducers/domainVisits.ts | 2 +- src/visits/reducers/nonOrphanVisits.ts | 4 +++- src/visits/reducers/orphanVisits.ts | 4 +++- src/visits/reducers/shortUrlVisits.ts | 1 + src/visits/reducers/tagVisits.ts | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/visits/reducers/domainVisits.ts b/src/visits/reducers/domainVisits.ts index 3570e023..17ee4f63 100644 --- a/src/visits/reducers/domainVisits.ts +++ b/src/visits/reducers/domainVisits.ts @@ -50,7 +50,7 @@ export default buildReducer({ [GET_DOMAIN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_DOMAIN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), [GET_DOMAIN_VISITS]: (state, { visits, domain, query }) => ( - { ...state, visits, domain, query, loading: false, error: false } + { ...state, visits, domain, query, loading: false, loadingLarge: false, error: false } ), [GET_DOMAIN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_DOMAIN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), diff --git a/src/visits/reducers/nonOrphanVisits.ts b/src/visits/reducers/nonOrphanVisits.ts index 41d1a5dc..05133800 100644 --- a/src/visits/reducers/nonOrphanVisits.ts +++ b/src/visits/reducers/nonOrphanVisits.ts @@ -45,7 +45,9 @@ const initialState: VisitsInfo = { export default buildReducer({ [GET_NON_ORPHAN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_NON_ORPHAN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_NON_ORPHAN_VISITS]: (state, { visits, query }) => ({ ...state, visits, query, loading: false, error: false }), + [GET_NON_ORPHAN_VISITS]: (state, { visits, query }) => ( + { ...state, visits, query, loading: false, loadingLarge: false, error: false } + ), [GET_NON_ORPHAN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_NON_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_NON_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), diff --git a/src/visits/reducers/orphanVisits.ts b/src/visits/reducers/orphanVisits.ts index 69fec2cd..8b6aee65 100644 --- a/src/visits/reducers/orphanVisits.ts +++ b/src/visits/reducers/orphanVisits.ts @@ -48,7 +48,9 @@ const initialState: VisitsInfo = { export default buildReducer({ [GET_ORPHAN_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_ORPHAN_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_ORPHAN_VISITS]: (state, { visits, query }) => ({ ...state, visits, query, loading: false, error: false }), + [GET_ORPHAN_VISITS]: (state, { visits, query }) => ( + { ...state, visits, query, loading: false, loadingLarge: false, error: false } + ), [GET_ORPHAN_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_ORPHAN_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_ORPHAN_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), diff --git a/src/visits/reducers/shortUrlVisits.ts b/src/visits/reducers/shortUrlVisits.ts index 9f568768..00327c46 100644 --- a/src/visits/reducers/shortUrlVisits.ts +++ b/src/visits/reducers/shortUrlVisits.ts @@ -53,6 +53,7 @@ export default buildReducer({ domain, query, loading: false, + loadingLarge: false, error: false, }), [GET_SHORT_URL_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), diff --git a/src/visits/reducers/tagVisits.ts b/src/visits/reducers/tagVisits.ts index b57f6836..f2fe6b85 100644 --- a/src/visits/reducers/tagVisits.ts +++ b/src/visits/reducers/tagVisits.ts @@ -46,7 +46,9 @@ const initialState: TagVisits = { export default buildReducer({ [GET_TAG_VISITS_START]: () => ({ ...initialState, loading: true }), [GET_TAG_VISITS_ERROR]: (_, { errorData }) => ({ ...initialState, error: true, errorData }), - [GET_TAG_VISITS]: (state, { visits, tag, query }) => ({ ...state, visits, tag, query, loading: false, error: false }), + [GET_TAG_VISITS]: (state, { visits, tag, query }) => ( + { ...state, visits, tag, query, loading: false, loadingLarge: false, error: false } + ), [GET_TAG_VISITS_LARGE]: (state) => ({ ...state, loadingLarge: true }), [GET_TAG_VISITS_CANCEL]: (state) => ({ ...state, cancelLoad: true }), [GET_TAG_VISITS_PROGRESS_CHANGED]: (state, { progress }) => ({ ...state, progress }), From 3a657e1e2f557813cdb23e9331e68a57225fcc5b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 13 Sep 2022 16:00:27 +0200 Subject: [PATCH 5/5] Updated changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6034fab1..3a20e268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [3.7.3] - 2022-09-13 ### Added * [#703](https://github.com/shlinkio/shlink-web-client/issues/703) Added support to publish docker image in GHCR. @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * *Nothing* ### Fixed -* *Nothing* +* [#709](https://github.com/shlinkio/shlink-web-client/issues/709) Fixed visits not being displayed after a large loading has finished. ## [3.7.2] - 2022-08-07