Skip to content

Commit

Permalink
Update google analytics, add staging deployment makefile & gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Skretzschmann committed Apr 11, 2024
1 parent e70be2e commit 99d7cf6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/staging_cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy staging branch

on:
push:
branches:
- staging

jobs:
staging_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: "Checkout a9s-cli-v2"
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
token: ${{ secrets.GIT_TOKEN }}
- name: Install
run: |
yarn
yarn run docusaurus build
PASSWORD=${{secrets.HTPASSWD}} make config_staging
- uses: citizen-of-planet-earth/cf-cli-action@master
with:
cf_api: https://api.de.a9s.eu
cf_username: ${{ secrets.PAAS_EMAIL }}
cf_password: ${{ secrets.PAAS_PASSWORD }}
cf_org: anynines
cf_space: staging
command: push a9s-cliv-v2-staging -p docs/build
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
config_staging: guard-PASSWORD
cd build && echo "force_https: true" > Staticfile
cd build && htpasswd -nb anynines ${PASSWORD} > Staticfile.auth

deploy_staging:
cf t -o anynines -s staging
cd build && cf push a9s-cli-v2-staging

cleanup:
rm -rf build/Staticfile
rm -rf build/Staticfile.auth

staging: config_staging deploy_staging cleanup

guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const usercentricsScript = ({ NODE_ENV }) => {
const googleTagScript = () => {
const config = {
type: "text/plain",
src: "https://www.googletagmanager.com/gtag/js?id=GTM-NZZ5ZVC",
src: "https://www.googletagmanager.com/gtag/js?id=GTM-WV4MM8RQ",
"data-usercentrics": "Google Tag Manager",
async: true
};
Expand Down

0 comments on commit 99d7cf6

Please sign in to comment.