Made publicPath relative to support all base urls without rebuilding
This commit is contained in:
parent
bb7dff3364
commit
646f16d364
|
@ -1,89 +0,0 @@
|
|||
name: Docker Subfolder
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
buildx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: get-npm-version
|
||||
id: package-version
|
||||
uses: martinbeentjes/npm-get-version-action@master
|
||||
|
||||
-
|
||||
name: Prepare
|
||||
id: prepare
|
||||
run: |
|
||||
DOCKER_IMAGE=ttshivers/synclounge
|
||||
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x
|
||||
VERSION=latest
|
||||
BASE_URL="/synclounge"
|
||||
SOURCE_BRANCH=${GITHUB_REF#refs/heads/}
|
||||
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
fi
|
||||
|
||||
VERSION="${VERSION}-subfolder"
|
||||
|
||||
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
|
||||
|
||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||
echo ::set-output name=version::${VERSION}
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||
--build-arg REVISION=${GITHUB_SHA:0:7} \
|
||||
--build-arg SOURCE_BRANCH=${SOURCE_BRANCH} \
|
||||
--build-arg VERSION=${{ steps.package-version.outputs.current-version}} \
|
||||
--build-arg BASE_URL=${BASE_URL} \
|
||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||
${TAGS} --file ./Dockerfile ./
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v3
|
||||
-
|
||||
name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
id: cache
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
-
|
||||
name: Docker Buildx (build)
|
||||
run: |
|
||||
docker buildx build \
|
||||
--output "type=image,push=false" \
|
||||
${{ steps.prepare.outputs.buildx_args }}
|
||||
-
|
||||
name: Docker Login
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
||||
-
|
||||
name: Docker Buildx (push)
|
||||
run: |
|
||||
docker buildx build \
|
||||
--output "type=image,push=true" \
|
||||
${{ steps.prepare.outputs.buildx_args }}
|
||||
-
|
||||
name: Docker Check Manifest
|
||||
run: |
|
||||
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
||||
-
|
||||
name: Clear
|
||||
if: always()
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
|
@ -8,7 +8,6 @@ COPY . .
|
|||
ARG SERVERS='[{"name":"Local Server","location":"Local","url":"","image":"synclounge-white.png"}]'
|
||||
ARG SOURCE_BRANCH
|
||||
ARG REVISION
|
||||
ARG BASE_URL
|
||||
|
||||
RUN npm run build
|
||||
|
||||
|
@ -42,7 +41,4 @@ LABEL org.opencontainers.image.version=$VERSION
|
|||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
LABEL org.opencontainers.image.documentation="https://docs.synclounge.tv/"
|
||||
|
||||
|
||||
ARG BASE_URL
|
||||
ENV BASE_URL ${BASE_URL}
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
|
|
|
@ -7,7 +7,6 @@ Vue.use(Router);
|
|||
|
||||
// ==================== Router registration ====================
|
||||
export default new Router({
|
||||
base: process.env.BASE_URL,
|
||||
mode: 'hash',
|
||||
routes: [
|
||||
{
|
||||
|
|
|
@ -24,11 +24,12 @@ try {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
// Relative publicPath to support subfolders
|
||||
publicPath: '',
|
||||
lintOnSave: process.env.NODE_ENV !== 'production',
|
||||
productionSourceMap: false,
|
||||
transpileDependencies: ['vuetify'],
|
||||
configureWebpack: {
|
||||
devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-eval-source-map',
|
||||
resolve: {
|
||||
alias: {
|
||||
// Alias @ to /src folder for ES/TS imports
|
||||
|
|
Loading…
Reference in New Issue