Fix prod deployment cache issue and analytics templating

This commit is contained in:
Keavon Chambers
2023-08-12 13:44:11 -07:00
parent fd338c945f
commit cfe38c6413
3 changed files with 19 additions and 3 deletions
+9 -2
View File
@@ -9,6 +9,7 @@ on:
- master
env:
CARGO_TERM_COLOR: always
INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="dev.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.outbound-links.file-downloads.js"></script>
jobs:
build:
@@ -44,6 +45,12 @@ jobs:
rustup update stable
rustc --version
- name: Replace template in <head> of index.html
run: |
# Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys)
git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_REPLACEMENT=""
sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html
- name: 🌐 Build Graphite web code
env:
NODE_ENV: production
@@ -58,8 +65,8 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: graphite-dev # e.g. 'my-project'
directory: frontend/dist # e.g. 'dist'
projectName: graphite-dev
directory: frontend/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: 👕 Lint Graphite web formatting