Skip to main content

Move your deploy pipeline to Nife with GitHub Actions

If you deployed from GitHub Actions or another CI on your old platform, you can deploy to Nife from the same pipeline.

Before you start​

  • A Nife app that is already created and deployed once.
  • A Nife access token. Create one on the Access Tokens page.
  • Your code in a GitHub repository.

Step 1: Store the token in GitHub​

  1. In your repository, go to Settings, then Secrets and variables, then Actions.
  2. Click New repository secret.
  3. Name it NIFE_ACCESS_TOKEN and paste your Nife access token as the value.

Step 2: Add the workflow​

Create .github/workflows/deploy.yml. This follows Nife's GitHub Actions guide:

name: Deploy to Nife
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nifectl
run: |
curl -L https://github.com/nifetency/nife-release/releases/latest/download/nifectl_linux_amd64 -o nifectl
chmod +x nifectl
sudo mv nifectl /usr/local/bin/
- name: Deploy to Nife
env:
NIFE_ACCESS_TOKEN: ${{ secrets.NIFE_ACCESS_TOKEN }}
run: |
nifectl auth login --token $NIFE_ACCESS_TOKEN
nifectl deploy

Step 3: Test​

Push to main and watch the run in the Actions tab. Then check the app on Nife.

To build and push your own image first, then deploy it, see the GitHub Actions page in the Nife docs. It uses nifectl deploy --image YOUR-IMAGE.

Remove the old platform's deploy step once Nife deploys work.

Need help? Email support@nife.io.