Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync prod and staging repo #317

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/metamask.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Metamask Request
about: Request regarding Metamask.io for the Website Team
title: "[Metamask]"
labels: 'metamask,'
assignees: cuonglt-ync, jlazoff, dcpnlau, SunnySian, SaraCheikh, nkkurt
assignees: cuonglt-ync, jlazoff, dcpnlau, SaraCheikh, nkkurt

---
**YNC:** (Internal Use Only - Ignore)
Expand Down
41 changes: 23 additions & 18 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ jobs:
with:
persist-credentials: false

- name: Create production env file
- name: Create env file
run: |
touch gatsby.production.env
echo GATSBY_CONTENTFUL_API_KEY =${{ secrets.GATSBY_CONTENTFUL_API_KEY }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_DOWNLOAD_LOCAL =${{ secrets.GATSBY_CONTENTFUL_DOWNLOAD_LOCAL }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_ENVIRONMENT =${{ secrets.GATSBY_CONTENTFUL_ENVIRONMENT }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_HOST =${{ secrets.GATSBY_CONTENTFUL_HOST }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_SPACE_ID =${{ secrets.GATSBY_CONTENTFUL_SPACE_ID }} >> gatsby.production.env
echo GATSBY_GA_ID =${{ secrets.GATSBY_GA_ID }} >> gatsby.production.env
echo GATSBY_GTM_ID =${{ secrets.GATSBY_GTM_ID }} >> gatsby.production.env
echo GATSBY_CONSENSYS_HOST =${{ secrets.GATSBY_CONSENSYS_HOST }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_PREVIEW_HOST =${{ secrets.GATSBY_CONTENTFUL_PREVIEW_HOST }} >> gatsby.production.env
echo GATSBY_CONTENTFUL_PREVIEW_API_KEY =${{ secrets.GATSBY_CONTENTFUL_PREVIEW_API_KEY }} >> gatsby.production.env
echo GATSBY_OSANO_CUSTOMER_ID =${{ secrets.GATSBY_OSANO_CUSTOMER_ID }} >> gatsby.production.env
echo GATSBY_OSANO_CCID_ID =${{ secrets.GATSBY_OSANO_CCID_ID }} >> gatsby.production.env
echo GH_TOKEN =${{ secrets.GH_TOKEN }} >> gatsby.production.env
touch .env
echo GATSBY_CONTENTFUL_API_KEY=${{ secrets.GATSBY_CONTENTFUL_API_KEY }} >> .env
echo GATSBY_CONTENTFUL_DOWNLOAD_LOCAL=${{ secrets.GATSBY_CONTENTFUL_DOWNLOAD_LOCAL }} >> .env
echo GATSBY_CONTENTFUL_ENVIRONMENT=${{ secrets.GATSBY_CONTENTFUL_ENVIRONMENT }} >> .env
echo GATSBY_CONTENTFUL_HOST=${{ secrets.GATSBY_CONTENTFUL_HOST }} >> .env
echo GATSBY_CONTENTFUL_SPACE_ID=${{ secrets.GATSBY_CONTENTFUL_SPACE_ID }} >> .env
echo GATSBY_GA_ID=${{ secrets.GATSBY_GA_ID }} >> .env
echo GATSBY_GTM_ID=${{ secrets.GATSBY_GTM_ID }} >> .env
echo GATSBY_CONSENSYS_HOST=${{ secrets.GATSBY_CONSENSYS_HOST }} >> .env
echo GATSBY_CONTENTFUL_PREVIEW_HOST=${{ secrets.GATSBY_CONTENTFUL_PREVIEW_HOST }} >> .env
echo GATSBY_CONTENTFUL_PREVIEW_API_KEY=${{ secrets.GATSBY_CONTENTFUL_PREVIEW_API_KEY }} >> .env
echo GATSBY_OSANO_CUSTOMER_ID=${{ secrets.GATSBY_OSANO_CUSTOMER_ID }} >> .env
echo GATSBY_OSANO_CCID_ID=${{ secrets.GATSBY_OSANO_CCID_ID }} >> .env
echo GH_TOKEN=${{ secrets.GH_TOKEN }} >> .env

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
Expand All @@ -48,13 +48,18 @@ jobs:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- run: |
yarn
yarn deploy
if [ ${{ vars.IS_STAGING == 'true' }} ]; then
yarn deploy:dev
else
yarn deploy
fi

env:
CI: true

- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages # The branch the action should deploy to.
publish_dir: ./public # The folder the action should deploy.
publish_branch: gh-pages
publish_dir: ./public
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Built With:
├── ...
├── html.js
├── gatsby-config.js
├── gatsby.[development].env]
├── .env
├── GraphQL_Query_Documentation.md
├── package.json
└── README.md
Expand Down
4 changes: 2 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const activeEnv =
process.env.ACTIVE_ENV || process.env.NODE_ENV || 'development'
const envConfig = {
path: `${__dirname}/gatsby.${activeEnv}.env`,
path: `${__dirname}/.env`,
}

const env = require('dotenv').config(envConfig)
Expand All @@ -13,7 +13,7 @@ if (env.errors) {
module.exports = {
siteMetadata: {
title: 'MetaMask',
description: `MetaMask is a ConsenSys Formation.`,
description: `MetaMask is a Consensys Formation.`,
siteUrl:
activeEnv === 'development'
? 'https://metamask.consensys.io'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "metamask-io",
"description": "Website of MetaMask",
"version": "2.0.0",
"author": "MetaMask • A ConsenSys Formation",
"author": "MetaMask • A Consensys Formation",
"license": "MIT",
"scripts": {
"dev": "gatsby develop",
"build": "gatsby build",
"deploy": "yarn build && touch public/.nojekyll && touch public/CNAME && echo \"metamask.io\" >> public/CNAME",
"build:dev": "ACTIVE_ENV=development gatsby build",
"deploy:dev": "yarn build:dev && touch public/.nojekyll && touch public/CNAME && echo \"metamask.consensys.io\" >> public/CNAME",
"serve": "gatsby serve --port 8000",
"clean": "rm -rf node_modules; rm -rf .cache; rm -rf public; yarn install;",
"start": "yarn develop",
Expand Down