add plausible, replace circleci with github workflows
This commit is contained in:
parent
b78c8a839f
commit
e1bb9ec1b0
|
@ -1,29 +0,0 @@
|
||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:14.18.0-browsers
|
|
||||||
working_directory: ~/twhelpwebsite
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- setup_remote_docker:
|
|
||||||
version: 20.10.2
|
|
||||||
# start proprietary DB using private Docker image
|
|
||||||
# with credentials stored in the UI
|
|
||||||
- run: |
|
|
||||||
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
||||||
# build the application image
|
|
||||||
- run: docker build -t $DOCKER_LOGIN/twhelp-website:latest .
|
|
||||||
|
|
||||||
# deploy the image
|
|
||||||
- run: docker push $DOCKER_LOGIN/twhelp-website:latest
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
deploy_prod:
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
context: TWHelp
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
name: Build and push to registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push_to_registry:
|
||||||
|
name: Push Docker image to Docker Hub
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get the version
|
||||||
|
id: get_version
|
||||||
|
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.REGISTRY_LOGIN }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push to Docker Hub
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
build-args: |
|
||||||
|
PLAUSIBLE_CUSTOM_DOMAIN=${{ secrets.PLAUSIBLE_CUSTOM_DOMAIN }}
|
||||||
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||||
|
tags: |
|
||||||
|
${{ secrets.REGISTRY_NAME }}/twhelp-website:latest
|
||||||
|
${{ secrets.REGISTRY_NAME }}/twhelp-website:${{ steps.get_version.outputs.VERSION }}
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
|
@ -1,6 +1,9 @@
|
||||||
FROM node:14.18.1-alpine as build-deps
|
FROM node:14.18.1-alpine as build-deps
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ARG PLAUSIBLE_CUSTOM_DOMAIN=""
|
||||||
|
|
||||||
|
ENV PLAUSIBLE_CUSTOM_DOMAIN=$PLAUSIBLE_CUSTOM_DOMAIN \
|
||||||
|
NODE_ENV=production
|
||||||
|
|
||||||
RUN apk --no-cache add shadow \
|
RUN apk --no-cache add shadow \
|
||||||
gcc \
|
gcc \
|
||||||
|
@ -16,9 +19,9 @@ RUN apk --no-cache add shadow \
|
||||||
zlib-dev \
|
zlib-dev \
|
||||||
file \
|
file \
|
||||||
pkgconf
|
pkgconf
|
||||||
RUN npm install --global gatsby-cli@3.3.0
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
|
RUN yarn global add gatsby-cli@3.3.0
|
||||||
RUN yarn
|
RUN yarn
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
const baseUrl = 'tribalwarshelp.com';
|
const DOMAIN = 'tribalwarshelp.com';
|
||||||
const siteUrl = 'https://' + baseUrl;
|
const SITE_URL = 'https://' + DOMAIN;
|
||||||
const apiUrl = 'https://api.' + baseUrl;
|
const API_URL = 'https://api.' + DOMAIN;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
siteMetadata: {
|
siteMetadata: {
|
||||||
title: `TWHelp`,
|
title: `TWHelp`,
|
||||||
description: `Tools for the popular online game TribalWars.`,
|
description: `Tools for the popular online game TribalWars.`,
|
||||||
dcbotUrl: 'https://dcbot.' + baseUrl,
|
dcbotUrl: 'https://dcbot.' + DOMAIN,
|
||||||
apiUrl,
|
apiUrl: API_URL,
|
||||||
author: 'Dawid Wysokiński',
|
author: 'Dawid Wysokiński',
|
||||||
authorEmail: 'contact@dwysokinski.me',
|
authorEmail: 'contact@dwysokinski.me',
|
||||||
contactUrl: 'https://dwysokinski.me/#contact',
|
contactUrl: 'https://dwysokinski.me/#contact',
|
||||||
scriptsUrl: 'https://github.com/tribalwarshelp/scripts',
|
scriptsUrl: 'https://github.com/tribalwarshelp/scripts',
|
||||||
siteUrl,
|
siteUrl: SITE_URL,
|
||||||
baseUrl,
|
baseUrl: DOMAIN,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
`gatsby-plugin-react-helmet`,
|
`gatsby-plugin-react-helmet`,
|
||||||
|
@ -57,8 +57,8 @@ module.exports = {
|
||||||
{
|
{
|
||||||
resolve: 'gatsby-plugin-robots-txt',
|
resolve: 'gatsby-plugin-robots-txt',
|
||||||
options: {
|
options: {
|
||||||
host: siteUrl,
|
host: SITE_URL,
|
||||||
sitemap: siteUrl + '/sitemap.xml',
|
sitemap: SITE_URL + '/sitemap.xml',
|
||||||
env: {
|
env: {
|
||||||
development: {
|
development: {
|
||||||
policy: [{ userAgent: '*', disallow: ['/'] }],
|
policy: [{ userAgent: '*', disallow: ['/'] }],
|
||||||
|
@ -77,7 +77,14 @@ module.exports = {
|
||||||
// This is the field under which it's accessible
|
// This is the field under which it's accessible
|
||||||
fieldName: 'twhelp',
|
fieldName: 'twhelp',
|
||||||
// URL to query from
|
// URL to query from
|
||||||
url: apiUrl + '/graphql',
|
url: API_URL + '/graphql',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
resolve: `@kichiyaki/gatsby-plugin-plausible`,
|
||||||
|
options: {
|
||||||
|
domain: DOMAIN,
|
||||||
|
customDomain: process.env.PLAUSIBLE_CUSTOM_DOMAIN,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"author": "Dawid Wysokiński <dawidwysokinski000@gmail.com>",
|
"author": "Dawid Wysokiński <dawidwysokinski000@gmail.com>",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@kichiyaki/gatsby-plugin-plausible": "^0.0.8",
|
||||||
"@kichiyaki/roboto": "^1.0.0",
|
"@kichiyaki/roboto": "^1.0.0",
|
||||||
"@material-ui/core": "^4.11.0",
|
"@material-ui/core": "^4.11.0",
|
||||||
"@material-ui/icons": "^4.9.1",
|
"@material-ui/icons": "^4.9.1",
|
||||||
|
|
18
yarn.lock
18
yarn.lock
|
@ -988,6 +988,13 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.13.4"
|
regenerator-runtime "^0.13.4"
|
||||||
|
|
||||||
|
"@babel/runtime@^7.9.2":
|
||||||
|
version "7.16.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5"
|
||||||
|
integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==
|
||||||
|
dependencies:
|
||||||
|
regenerator-runtime "^0.13.4"
|
||||||
|
|
||||||
"@babel/standalone@^7.12.6":
|
"@babel/standalone@^7.12.6":
|
||||||
version "7.13.17"
|
version "7.13.17"
|
||||||
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.13.17.tgz#921b82a11a80ce824589516736d629efc53297aa"
|
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.13.17.tgz#921b82a11a80ce824589516736d629efc53297aa"
|
||||||
|
@ -1572,6 +1579,15 @@
|
||||||
"@babel/runtime" "^7.7.2"
|
"@babel/runtime" "^7.7.2"
|
||||||
regenerator-runtime "^0.13.3"
|
regenerator-runtime "^0.13.3"
|
||||||
|
|
||||||
|
"@kichiyaki/gatsby-plugin-plausible@^0.0.8":
|
||||||
|
version "0.0.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/@kichiyaki/gatsby-plugin-plausible/-/gatsby-plugin-plausible-0.0.8.tgz#94f53c5a8f768b934228e4f43c5493c38885152b"
|
||||||
|
integrity sha512-DO03Z6NHRiwh8XHJtBJcLxMZ1a8cDjYM0inuGmNI33ea7fV4wdGVF5uHidlbdlls2hLfYPDkjOc0y2Yz3Ff/nw==
|
||||||
|
dependencies:
|
||||||
|
"@babel/runtime" "^7.9.2"
|
||||||
|
minimatch "3.0.4"
|
||||||
|
react "^17.0.2"
|
||||||
|
|
||||||
"@kichiyaki/roboto@^1.0.0":
|
"@kichiyaki/roboto@^1.0.0":
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@kichiyaki/roboto/-/roboto-1.0.0.tgz#6f5dfb40e2423940588946c952490b123ca8088b"
|
resolved "https://registry.yarnpkg.com/@kichiyaki/roboto/-/roboto-1.0.0.tgz#6f5dfb40e2423940588946c952490b123ca8088b"
|
||||||
|
@ -10976,7 +10992,7 @@ react-transition-group@^4.4.0:
|
||||||
loose-envify "^1.4.0"
|
loose-envify "^1.4.0"
|
||||||
prop-types "^15.6.2"
|
prop-types "^15.6.2"
|
||||||
|
|
||||||
react@^17.0.0:
|
react@^17.0.0, react@^17.0.2:
|
||||||
version "17.0.2"
|
version "17.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
|
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
|
||||||
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
|
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
|
||||||
|
|
Reference in New Issue