diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 11f59194a..9ab9b6589 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -31,17 +31,27 @@ jobs: npm ci --ignore-scripts env: NODE_AUTH_TOKEN: ${{ secrets.FONTAWESOME_AUTH_TOKEN }} - - name: Build - run: hugo --minify - - name: Upload artifact + - name: Build production + run: hugo --minify --destination public/prod + - name: Build staging + run: hugo --baseURL=https://staging.cryptomator.org/ --environment=staging --minify --destination public/staging + - name: Add robots.txt for staging + run: 'echo -e "User-agent: *\nDisallow: /" > public/staging/robots.txt' + - name: Upload Prod Pages artifact uses: actions/upload-pages-artifact@v3 with: - path: 'public' + name: prod-site + path: ./public/prod + - name: Upload Staging artifacts + uses: actions/upload-artifact@v4 + with: + name: staging-site + path: ./public/staging - # DEPLOY - deploy: + # DEPLOY PROD + deploy-prod: if: github.ref == 'refs/heads/main' - name: Deploy to GitHub Pages + name: Deploy Prod to GitHub Pages runs-on: ubuntu-latest needs: [build] permissions: # Grant GITHUB_TOKEN the permissions required to make a Pages deployment @@ -51,6 +61,30 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action + with: + artifact_name: prod-site environment: # Deploy to the github-pages environment name: github-pages url: ${{ steps.deployment.outputs.page_url }} + + # DEPLOY STAGING + deploy-staging: + if: github.ref == 'refs/heads/develop' + name: Deploy Staging to GitHub Pages + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Download build + uses: actions/download-artifact@v4 + with: + name: staging-site + path: ./public + - name: Deploy to Staging Repository + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.CRYPTOBOT_DEPLOY_STAGING_WEBSITE }} + external_repository: cryptomator/staging.cryptomator.org + publish_dir: ./public + publish_branch: main + cname: staging.cryptomator.org + diff --git a/config/staging/params.yaml b/config/staging/params.yaml index e03088624..827639b6b 100644 --- a/config/staging/params.yaml +++ b/config/staging/params.yaml @@ -1,6 +1,6 @@ # API -baseApiUrl: http://localhost -storeApiUrl: http://localhost:8787/api +baseApiUrl: https://api.staging.cryptomator.org +storeApiUrl: https://store.staging.cryptomator.org # UMAMI umamiWebsiteId: 57a36f3a-bd97-4d8a-9563-0e8d39ddb20c diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 59e768328..f12e7f019 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -59,6 +59,9 @@ {{ end }} {{ partial "hreflang.html" . }} + {{ if eq hugo.Environment "staging" }} + + {{ end }} {{ partial "nav.html" . }}