Skip to content

Commit

Permalink
Merge pull request #549 from thoth-pub/feature/deprecate_website
Browse files Browse the repository at this point in the history
Deprecate app public pages
  • Loading branch information
ja573 authored Mar 14, 2024
2 parents ba37929 + dd79ec8 commit f283745
Show file tree
Hide file tree
Showing 28 changed files with 191 additions and 1,169 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/build_test_and_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- uses: actions/checkout@v4
- name: Build binary
run: cargo build --verbose
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --verbose
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --workspace --verbose
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run linting
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets --all-features -- -D warnings
- uses: actions/checkout@v4
- name: Run linting
run: cargo clippy --all --all-targets --all-features -- -D warnings
format_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- uses: actions/checkout@v4
- name: Run format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check
30 changes: 0 additions & 30 deletions .github/workflows/docker_build.yml

This file was deleted.

40 changes: 29 additions & 11 deletions .github/workflows/docker_build_and_push_to_dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: publish-to-dockerhub

on:
release:
types: [published]
pull_request:
workflow_dispatch:

jobs:
build_and_push_docker_image:
build_and_push_staging_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
Expand All @@ -19,21 +19,19 @@ jobs:
openbookpublishers/thoth
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=pr,prefix=staging-pr-
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand All @@ -43,3 +41,23 @@ jobs:
THOTH_EXPORT_API=https://export.thoth.pub
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

build_dev_docker_image:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
push: false
tags: openbookpublishers/thoth:latest
file: Dockerfile.dev
build-args: |
THOTH_GRAPHQL_API=https://api.thoth.pub
THOTH_EXPORT_API=https://export.thoth.pub
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
45 changes: 45 additions & 0 deletions .github/workflows/docker_build_and_push_to_dockerhub_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: publish-to-dockerhub

on:
release:
types: [published]

jobs:
build_and_push_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
openbookpublishers/thoth
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
THOTH_GRAPHQL_API=https://api.thoth.pub
THOTH_EXPORT_API=https://export.thoth.pub
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
34 changes: 0 additions & 34 deletions .github/workflows/docker_build_dev.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/docker_build_dev_no_action.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/docker_build_no_action.yml

This file was deleted.

23 changes: 7 additions & 16 deletions .github/workflows/run_migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ jobs:
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: Run migrations
uses: actions-rs/cargo@v1
with:
command: run
args: migrate
- name: Revert migrations
uses: actions-rs/cargo@v1
with:
command: run
args: migrate --revert
- uses: actions/checkout@v4
- name: Build binary
run: cargo build --verbose
- name: Run migrations
run: cargo run migrate
- name: Revert migrations
run: cargo run migrate --revert
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ 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/spec/v2.0.0.html).

## [Unreleased]
### Removed
- [549](https://github.com/thoth-pub/thoth/pull/549) - Deprecate public-facing pages in Thoth APP in favour of a separate, standalone, website

### Added
- [549](https://github.com/thoth-pub/thoth/pull/549) - Build and push staging docker images on pull requests

### Changed
- [549](https://github.com/thoth-pub/thoth/pull/549) - Upgrade GitHub actions dependencies (`docker/setup-qemu-action@v3`, `docker/setup-buildx-action@v3`, `docker/login-action@v3`, `docker/build-push-action@v5`, `actions/checkout@v4`, `actions/setup-node@v4`)

## [[0.11.18]](https://github.com/thoth-pub/thoth/releases/tag/v0.11.18) - 2024-03-07
### Added
Expand Down
66 changes: 32 additions & 34 deletions thoth-app-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,38 @@ macro_rules! static_files {
}

static_files! {
(JS, js_file) => ("../static/pkg/thoth-app.js", "/thoth-app.js", "application/javascript"),
(WASM, wasm_file) => ("../static/pkg/thoth-app_bg.wasm", "/thoth-app_bg.wasm", "application/wasm"),
(BULMA, bulma_file) => ("../static/pkg/bulma-pageloader.min.css", "/bulma-pageloader.min.css", "text/css; charset=utf-8"),
(CSS, css_file) => ("../static/pkg/thoth.css", "/thoth.css", "text/css; charset=utf-8"),
(LOGO, logo_file) => ("../static/img/thoth-logo.png", "/img/thoth-logo.png", "image/png"),
(BANNER, banner_file) => ("../static/img/thoth-banner.png", "/img/thoth-banner.png", "image/png"),
(COVER, cover_file) => ("../static/img/cover-placeholder.jpg", "/img/cover-placeholder.jpg", "image/jpg"),
(XML, xml_file) => ("../static/browserconfig.xml", "/browserconfig.xml", "application/xml"),
(JSON, json_file) => ("../static/manifest.json", "/manifest.json", "application/json"),
(ICON, icon_file) => ("../static/img/favicon.ico", "/favicon.ico", "image/x-icon"),
(ICON1, icon_file1) => ("../static/img/android-icon-144x144.png", "/android-icon-144x144.png", "image/png"),
(ICON2, icon_file2) => ("../static/img/android-icon-192x192.png", "/android-icon-192x192.png", "image/png"),
(ICON3, icon_file3) => ("../static/img/android-icon-36x36.png", "/android-icon-36x36.png", "image/png"),
(ICON4, icon_file4) => ("../static/img/android-icon-48x48.png", "/android-icon-48x48.png", "image/png"),
(ICON5, icon_file5) => ("../static/img/android-icon-72x72.png", "/android-icon-72x72.png", "image/png"),
(ICON6, icon_file6) => ("../static/img/android-icon-96x96.png", "/android-icon-96x96.png", "image/png"),
(ICON7, icon_file7) => ("../static/img/apple-icon-114x114.png", "/apple-icon-114x114.png", "image/png"),
(ICON8, icon_file8) => ("../static/img/apple-icon-120x120.png", "/apple-icon-120x120.png", "image/png"),
(ICON9, icon_file9) => ("../static/img/apple-icon-144x144.png", "/apple-icon-144x144.png", "image/png"),
(ICON10, icon_file10) => ("../static/img/apple-icon-152x152.png", "/apple-icon-152x152.png", "image/png"),
(ICON11, icon_file11) => ("../static/img/apple-icon-180x180.png", "/apple-icon-180x180.png", "image/png"),
(ICON12, icon_file12) => ("../static/img/apple-icon-57x57.png", "/apple-icon-57x57.png", "image/png"),
(ICON13, icon_file13) => ("../static/img/apple-icon-60x60.png", "/apple-icon-60x60.png", "image/png"),
(ICON14, icon_file14) => ("../static/img/apple-icon-72x72.png", "/apple-icon-72x72.png", "image/png"),
(ICON15, icon_file15) => ("../static/img/apple-icon-76x76.png", "/apple-icon-76x76.png", "image/png"),
(ICON16, icon_file16) => ("../static/img/apple-icon-precomposed.png", "/apple-icon-precomposed.png", "image/png"),
(ICON17, icon_file17) => ("../static/img/apple-icon.png", "/apple-icon.png", "image/png"),
(ICON18, icon_file18) => ("../static/img/favicon-16x16.png", "/favicon-16x16.png", "image/png"),
(ICON19, icon_file19) => ("../static/img/favicon-32x32.png", "/favicon-32x32.png", "image/png"),
(ICON20, icon_file20) => ("../static/img/favicon-96x96.png", "/favicon-96x96.png", "image/png"),
(ICON21, icon_file21) => ("../static/img/ms-icon-144x144.png", "/ms-icon-144x144.png", "image/png"),
(ICON22, icon_file22) => ("../static/img/ms-icon-150x150.png", "/ms-icon-150x150.png", "image/png"),
(ICON23, icon_file23) => ("../static/img/ms-icon-310x310.png", "/ms-icon-310x310.png", "image/png"),
(ICON24, icon_file24) => ("../static/img/ms-icon-70x70.png", "/ms-icon-70x70.png", "image/png"),
(JS, js_file) => ("../static/pkg/thoth-app.js", "/admin/thoth-app.js", "application/javascript"),
(WASM, wasm_file) => ("../static/pkg/thoth-app_bg.wasm", "/admin/thoth-app_bg.wasm", "application/wasm"),
(BULMA, bulma_file) => ("../static/pkg/bulma-pageloader.min.css", "/admin/bulma-pageloader.min.css", "text/css; charset=utf-8"),
(CSS, css_file) => ("../static/pkg/thoth.css", "/admin/thoth.css", "text/css; charset=utf-8"),
(LOGO, logo_file) => ("../static/img/thoth-logo.png", "/admin/img/thoth-logo.png", "image/png"),
(XML, xml_file) => ("../static/browserconfig.xml", "/admin/browserconfig.xml", "application/xml"),
(JSON, json_file) => ("../static/manifest.json", "/admin/manifest.json", "application/json"),
(ICON, icon_file) => ("../static/img/favicon.ico", "/admin/favicon.ico", "image/x-icon"),
(ICON1, icon_file1) => ("../static/img/android-icon-144x144.png", "/admin/android-icon-144x144.png", "image/png"),
(ICON2, icon_file2) => ("../static/img/android-icon-192x192.png", "/admin/android-icon-192x192.png", "image/png"),
(ICON3, icon_file3) => ("../static/img/android-icon-36x36.png", "/admin/android-icon-36x36.png", "image/png"),
(ICON4, icon_file4) => ("../static/img/android-icon-48x48.png", "/admin/android-icon-48x48.png", "image/png"),
(ICON5, icon_file5) => ("../static/img/android-icon-72x72.png", "/admin/android-icon-72x72.png", "image/png"),
(ICON6, icon_file6) => ("../static/img/android-icon-96x96.png", "/admin/android-icon-96x96.png", "image/png"),
(ICON7, icon_file7) => ("../static/img/apple-icon-114x114.png", "/admin/apple-icon-114x114.png", "image/png"),
(ICON8, icon_file8) => ("../static/img/apple-icon-120x120.png", "/admin/apple-icon-120x120.png", "image/png"),
(ICON9, icon_file9) => ("../static/img/apple-icon-144x144.png", "/admin/apple-icon-144x144.png", "image/png"),
(ICON10, icon_file10) => ("../static/img/apple-icon-152x152.png", "/admin/apple-icon-152x152.png", "image/png"),
(ICON11, icon_file11) => ("../static/img/apple-icon-180x180.png", "/admin/apple-icon-180x180.png", "image/png"),
(ICON12, icon_file12) => ("../static/img/apple-icon-57x57.png", "/admin/apple-icon-57x57.png", "image/png"),
(ICON13, icon_file13) => ("../static/img/apple-icon-60x60.png", "/admin/apple-icon-60x60.png", "image/png"),
(ICON14, icon_file14) => ("../static/img/apple-icon-72x72.png", "/admin/apple-icon-72x72.png", "image/png"),
(ICON15, icon_file15) => ("../static/img/apple-icon-76x76.png", "/admin/apple-icon-76x76.png", "image/png"),
(ICON16, icon_file16) => ("../static/img/apple-icon-precomposed.png", "/admin/apple-icon-precomposed.png", "image/png"),
(ICON17, icon_file17) => ("../static/img/apple-icon.png", "/admin/apple-icon.png", "image/png"),
(ICON18, icon_file18) => ("../static/img/favicon-16x16.png", "/admin/favicon-16x16.png", "image/png"),
(ICON19, icon_file19) => ("../static/img/favicon-32x32.png", "/admin/favicon-32x32.png", "image/png"),
(ICON20, icon_file20) => ("../static/img/favicon-96x96.png", "/admin/favicon-96x96.png", "image/png"),
(ICON21, icon_file21) => ("../static/img/ms-icon-144x144.png", "/admin/ms-icon-144x144.png", "image/png"),
(ICON22, icon_file22) => ("../static/img/ms-icon-150x150.png", "/admin/ms-icon-150x150.png", "image/png"),
(ICON23, icon_file23) => ("../static/img/ms-icon-310x310.png", "/admin/ms-icon-310x310.png", "image/png"),
(ICON24, icon_file24) => ("../static/img/ms-icon-70x70.png", "/admin/ms-icon-70x70.png", "image/png"),
}

const INDEX_FILE: &[u8] = include_bytes!("../static/pkg/index.html");
Expand Down
2 changes: 1 addition & 1 deletion thoth-app/Trunk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# The output dir for all final assets.
dist = "pkg"
# The public URL from which assets are to be served.
public_url = "/"
public_url = "/admin/"
# Whether to include hash values in the output file names.
filehash = false

Expand Down
2 changes: 1 addition & 1 deletion thoth-app/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffdd57</TileColor></tile></msapplication></browserconfig>
<browserconfig><msapplication><tile><square70x70logo src="/admin/ms-icon-70x70.png"/><square150x150logo src="/admin/ms-icon-150x150.png"/><square310x310logo src="/admin/ms-icon-310x310.png"/><TileColor>#ffdd57</TileColor></tile></msapplication></browserconfig>
Loading

0 comments on commit f283745

Please sign in to comment.