Publish on Fleek #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish on Fleek | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
source_branch: | ||
description: 'Publish content from branch (master|staging)' | ||
required: true | ||
default: staging | ||
type: choice | ||
options: | ||
- master | ||
- staging | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code ( Branch=${{ inputs.source_branch }} ) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.source_branch }} | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- name: Install and build | ||
run: yarn install --frozen-lockfile && yarn build | ||
- name: Install Fleek CLI | ||
run: yarn global add @fleek-platform/cli | ||
- name: Activate Fleek | ||
run: mv fleek_${{ inputs.source_branch }}.json .fleek.json | ||
- name: Deploy on Fleek | ||
id: deploy | ||
run: fleek sites deploy | ||
with: | ||
FLEEK_TOKEN: ${{ secrets.FLEEK_TOKEN }} | ||
FLEEK_PROJECT_ID: ${{ secrets.FLEEK_PROJECT_ID }} | ||
- name: Get Fleek output URL ( Branch=${{ inputs.source_branch }} ) | ||
run: echo "The Fleek output URL is ${{ steps.deploy.outputs.deployUrl }}" |