Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs committed Jun 13, 2022
1 parent baa0a03 commit 35503ac
Show file tree
Hide file tree
Showing 43 changed files with 425 additions and 2,757 deletions.
28 changes: 14 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module.exports = {
"env": {
"browser": true,
"es6": true,
"jquery": true
"jquery": true,
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
"sourceType": "module",
},
"rules": {
"accessor-pairs": "off",
Expand All @@ -19,7 +19,7 @@ module.exports = {
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
"functions": "always-multiline",
}],
"comma-spacing": ["error", {"before": false, "after": true}],
"comma-style": ["error", "last"],
Expand All @@ -34,8 +34,8 @@ module.exports = {
"error",
"tab",
{
"SwitchCase": 1
}
"SwitchCase": 1,
},
],
"key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
"keyword-spacing": ["error", {"before": true, "after": true}],
Expand Down Expand Up @@ -78,9 +78,9 @@ module.exports = {
"groups": [
["==", "!=", "===", "!==", ">", ">=", "<", "<="],
["&&", "||"],
["in", "instanceof"]
["in", "instanceof"],
],
"allowSamePrecedence": true
"allowSamePrecedence": true,
}],
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
Expand Down Expand Up @@ -121,7 +121,7 @@ module.exports = {
"no-unused-expressions": ["error", {
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
"allowTaggedTemplates": true,
}],
"no-unused-vars": "off",
"no-use-before-define": ["error", {"functions": false, "classes": false, "variables": false}],
Expand All @@ -144,8 +144,8 @@ module.exports = {
"*": "before",
"/": "before",
"||": "before",
"&&": "before"
}
"&&": "before",
},
}],
"padded-blocks": ["error", {"blocks": "never", "switches": "never", "classes": "never"}],
"prefer-promise-reject-errors": "error",
Expand All @@ -161,8 +161,8 @@ module.exports = {
"block": {
"balanced": true,
"markers": ["*package", "!", ",", ":", "::", "flow-include"],
"exceptions": ["*"]
}
"exceptions": ["*"],
},
}],
"symbol-description": "error",
"template-curly-spacing": ["error", "never"],
Expand All @@ -178,6 +178,6 @@ module.exports = {
"no-console": "error",
"prefer-template": "error",
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
"no-var": "error"
}
"no-var": "error",
},
};
84 changes: 84 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build and Deploy

on:
push:
tags:
- 'v**'

env:
# See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
IMAGE_NAME: pf2etools

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

# See: https://stackoverflow.com/a/58178121
- name: Set Env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Archive Release
run: |
zip -r pf2ools-${{ env.RELEASE_VERSION }}.zip . -x '*.git*' '*node_modules*' '*.github*' '*img*' '*.editorconfig*' '*CNAME*'
- name: Set Deployed Flag
run: |
bash ./.github/set-deployed-flag.sh ${{ env.RELEASE_VERSION }}
# Remove entries from the `.gitignore` so the gh-pages action can correctly add+commit them to the pages branch
- name: Build Service Worker
run: |
node --version
npm --version
npm i
npm run build:sw:prod
sed -i 's/sw.js//g' .gitignore
sed -i 's/sw-injector.js//g' .gitignore
- name: Build SEO Pages
env:
VET_BASE_SITE_URL: https://pf2etools.com/
VET_SEO_IS_SKIP_UA_ETC: true
run: |
npm run build:seo -- ${{ env.RELEASE_VERSION }}
# See: https://github.com/JamesIves/github-pages-deploy-action
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: prod
folder: .

- name: Archive Images
run: |
zip -r -s 500m img-${{ env.RELEASE_VERSION }}.zip img/
- name: Upload Release
# Add the files one-by-one in an effort to avoid timeouts
run: |
hub release create -a pf2ools-${{ env.RELEASE_VERSION }}.zip -m ${{ env.RELEASE_VERSION }} ${{ env.RELEASE_VERSION }}
for f in $(find . -name 'img-${{ env.RELEASE_VERSION }}.*' -print); do hub release edit ${{ env.RELEASE_VERSION }} -m '' -a $f; done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# region See: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
- name: Build Image
run: |
docker build -t $IMAGE_NAME .
- name: Log In to Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push Image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
# Always tag latest when pushing a tag, as we don't expect to ever merge old tags
[[ "${{ github.ref }}" == "refs/tags/"* ]] && docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:latest
# endregion
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Pf2e.Tools
[![Automated Build](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/build.yml)
[![Automated Build](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/Pf2eToolsOrg/Pf2eTools/actions/workflows/main.yml)

Visit the main site (not yet) or go to the unofficial GitHub [mirror](https://pf2etools.com).

Expand Down
4 changes: 2 additions & 2 deletions css/style.css

Large diffs are not rendered by default.

Loading

0 comments on commit 35503ac

Please sign in to comment.