From b0db030b4021238d7e8f5fa6671eca28010583b9 Mon Sep 17 00:00:00 2001 From: Mentor Palokaj Date: Sat, 16 Oct 2021 13:48:19 +0200 Subject: [PATCH] Attempt first deploy --- .firebaserc | 14 +++- .github/workflows/deploy-minter.yaml | 65 +++++++++++++++++++ .github/workflows/deploy-website.yml | 65 +++++++++++++++++++ firebase.json | 18 ++--- website/src/css/essential-above-the-fold.sass | 2 + website/src/index.pug | 19 +++--- 6 files changed, 166 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/deploy-minter.yaml create mode 100644 .github/workflows/deploy-website.yml diff --git a/.firebaserc b/.firebaserc index 78c59aa..fd5c7dd 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,5 +1,17 @@ { "projects": { "default": "rocketeer-nft" + }, + "targets": { + "rocketeer-nft": { + "hosting": { + "website": [ + "rocketeer" + ], + "minter": [ + "rocketeer-nft" + ] + } + } } -} +} \ No newline at end of file diff --git a/.github/workflows/deploy-minter.yaml b/.github/workflows/deploy-minter.yaml new file mode 100644 index 0000000..1ae5323 --- /dev/null +++ b/.github/workflows/deploy-minter.yaml @@ -0,0 +1,65 @@ +name: Deploy Frontend on push/merge + +# Only trigger on PR/push and only for frontend files +on: + # Trigger on PR close + # pull_request: + # types: [ closed ] + # paths: + # - 'src/**' + # - 'modules/**' + # branches: + # - master + + # Trigger on push to master (edge case, local merge) + push: + branches: + - master + paths: + - '*.json' + - '*.js' + - 'minter/**' + - '.github/workflows/deploy-minter.yml' + +jobs: + # Build the frontend giles + build: + name: Compile frontend + + runs-on: ubuntu-latest + + steps: + # Get the repo files from current commit + - name: Cloning repository + uses: actions/checkout@v1 + + - name: Read .nvmrc + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + id: nvm + working-directory: minter + + - name: Set Node.js (.nvmrc) + uses: actions/setup-node@v1 + with: + node-version: "${{ steps.nvm.outputs.NVMRC }}" + + - name: Install dependencies + run: npm i + working-directory: minter + + - name: test if all links work + run: npm test + working-directory: minter + + - name: Build website files + env: + NODE_ENV: production + run: npm run build + working-directory: minter + + - name: Deploy to Firebase + uses: w9jds/firebase-action@master + with: + args: deploy --only hosting:minter + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml new file mode 100644 index 0000000..be9564f --- /dev/null +++ b/.github/workflows/deploy-website.yml @@ -0,0 +1,65 @@ +name: Deploy Frontend on push/merge + +# Only trigger on PR/push and only for frontend files +on: + # Trigger on PR close + # pull_request: + # types: [ closed ] + # paths: + # - 'src/**' + # - 'modules/**' + # branches: + # - master + + # Trigger on push to master (edge case, local merge) + push: + branches: + - master + paths: + - '*.json' + - '*.js' + - 'website/**' + - '.github/workflows/deploy-website.yml' + +jobs: + # Build the frontend giles + build: + name: Compile frontend + + runs-on: ubuntu-latest + + steps: + # Get the repo files from current commit + - name: Cloning repository + uses: actions/checkout@v1 + + - name: Read .nvmrc + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + id: nvm + working-directory: website + + - name: Set Node.js (.nvmrc) + uses: actions/setup-node@v1 + with: + node-version: "${{ steps.nvm.outputs.NVMRC }}" + + - name: Install dependencies + run: npm i + working-directory: website + + - name: test if all links work + run: npm test + working-directory: website + + - name: Build website files + env: + NODE_ENV: production + run: npm run build + working-directory: website + + - name: Deploy to Firebase + uses: w9jds/firebase-action@master + with: + args: deploy --only hosting:website + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} diff --git a/firebase.json b/firebase.json index f6962ed..b89ba04 100644 --- a/firebase.json +++ b/firebase.json @@ -8,14 +8,16 @@ "npm --prefix \"$RESOURCE_DIR\" run lint" ] }, - "hosting": { - "public": "docs", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ] - }, + "hosting": [ + { + "target": "website", + "public": "website/docs" + }, + { + "target": "minter", + "public": "minter/docs" + } + ], "storage": { "rules": "storage.rules" } diff --git a/website/src/css/essential-above-the-fold.sass b/website/src/css/essential-above-the-fold.sass index 255f64d..f41b3cc 100644 --- a/website/src/css/essential-above-the-fold.sass +++ b/website/src/css/essential-above-the-fold.sass @@ -103,6 +103,8 @@ main #ctabuttons margin-top: 4rem + width: 100% + text-align: center a padding: 1rem text-decoration: none diff --git a/website/src/index.pug b/website/src/index.pug index e2156c2..ed3bb83 100644 --- a/website/src/index.pug +++ b/website/src/index.pug @@ -24,22 +24,24 @@ html( lang=content.lang ) main section#hero h1 Rocketeer NFT - h2 10,000,000 possible combinations, 0 price. - a( target='_blank' href='' ) Mint now + //- h2 10,000,000 possible combinations, 0 price. + //- a( target='_blank' href='' ) Mint now + p Launching Soon™️ +rimg.stretch( src=site.system.url+'/assets/mike-kiev-Opzk_hvwO9Q-unsplash.jpg' ) section#usps div.usp p 🕶 - p 5 visors in 20 possible colors + p Unique visors & helmets div.usp p 👔 - p 9 suits in 10 colors + p Unique suits div.usp p 🏔 - p 20 backdrops in 5 colors + p Unique backdrops div#ctabuttons - a( href='/' ) Mint now - a( href='/' ) View on Opensea + //- a( href='/' ) Mint now + //- a( href='/' ) View on Opensea + p Launching Soon™️ section#credits h1 Acknowledgements @@ -48,7 +50,8 @@ html( lang=content.lang ) section#cta +cimg.circle#compressed( size=200 src=site.system.url+'/assets/adam-miller-dBaz0xhCkPY-unsplash-cropped.jpg' ) - a( href='/' ) Mint now + //- a( href='/' ) Mint now + p Launching Soon™️ section#about h1 About this project