Published on

GitHub Actions

Authors

Fume now has an official GitHub action with detailed instructions on how to set it up. Head on over to the marketplace to see detailed instructions.

TL;DR:

  1. Set a GitHub Secret as FUME_TOKEN with a created token from the tokens section
  2. Add and check-in a Workflow File in your repo - ex: .github/workflows/deploy-fume.yml using syntax similar to
name: Deploy with fume

on:
  push:
    branches: [ staging, production ]

jobs:
  fume:
    name: Deploy with Fume
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: fumeapp/action@master
      with:
        token: ${{ secrets.FUME_TOKEN }}
        # this passes the name of the branch
        environment: ${GITHUB_REF##*/}

This workflow will deploy to the staging and production environments if commits and/or merges happen in branches of the same name

This can also be achieved with GitLab CI/CD:

  1. Do the same as step 1 above but set it in Settings -> Ci/CD, Variables -> Expand and Add Variable
  2. Add a workflow file as .gitlab-ci.yml in your repository
  stages:
   - deploy

  deploy:
    image: node:latest
    stage: deploy
    script:
      - apt-get update -y
      - apt-get install zip -y
      - export FUME_TOKEN=$FUME_TOKEN
      - npm i -g fume-cli
      - fume deploy staging
    only:
      - staging

This workflow will deploy to the staging and production environments if commits and/or merges happen in branches of the same name