Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Merge pull request #255 from githubnext/jaked/blocks-completed-banner #319

Merge pull request #255 from githubnext/jaked/blocks-completed-banner

Merge pull request #255 from githubnext/jaked/blocks-completed-banner #319

Workflow file for this run

name: Deploy to Azure (githubnext-blocks-staging)
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
if: steps.cache-yarn.outputs.cache-hit != 'true'
run: |
yarn
- name: Cache next
uses: actions/cache@v3
id: cache-next
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn-lock') }}-
- name: yarn build
run: |
yarn build
- name: package zip
run: zip -r web.zip package.json next.config.js .next node_modules/ public/
- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "githubnext-blocks"
slot-name: "staging"
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
package: web.zip