Auto Deploy with GitHub Action
Learn how to deploy your application automatically with GitHub action
Andasy-action is a GitHub Action that automatically deploys your GitHub repository to the Andasy platform whenever you push code. This enables continuous deployment (CD), which automates the process of deploying your application whenever code changes are pushed to your repository.
With the Andasy GitHub Action:
- Automatic deployments - Every push to your main branch (or any branch you configure) triggers a deployment
- No manual steps - No need to run
andasy deploymanually - Consistent process - Every deployment follows the same automated process
- Faster releases - Code changes go live automatically after tests pass
This is especially useful for teams where multiple developers push code frequently, as it ensures the latest code is always deployed without manual intervention.
Features
- Automated Deployment : Deploy your project to
andasy.iowith ease. - Secure Authentication : Use
ANDASY_ACCESS_TOKENfor secure access. - Customizable Workflows : Easily integrate with your existing CI/CD workflows.
Prerequisites
Before setting up the GitHub Action, you need to:
- Have an Andasy account - Sign up at andasy.io if you haven't already
- Set up your application - Run
andasy setupin your project to create theandasy.hclconfiguration file - Get an access token - Generate a token for the GitHub Action to authenticate
Obtain Access Token
The GitHub Action needs an access token to authenticate with Andasy on your behalf. Generate one:
- Run the following command on your local machine (make sure you're authenticated):
andasy auth token - Copy the generated token value, you'll need it in the next step.
Keep Tokens Secure:
Access tokens provide full access to your Andasy account. Keep them confidential and never commit them to your repository. Store them only as GitHub secrets.
Set Up Repository Secrets
Add the token as a GitHub secret so the action can use it securely:
- Navigate to your repository on GitHub
- Go to
Settings>Secrets and variables>Actions - Click
New repository secret - Add a new secret with:
- Name:
ANDASY_ACCESS_TOKEN - Value: Paste the token you copied from
andasy auth token
- Name:
- Click
Add secret
The token is now stored securely and accessible to your GitHub Actions workflows, but never exposed in logs or code.
Usage
To use the andasy-action, create a GitHub Actions workflow file in your repository. Workflow files define when and how your actions run.
Creating a Workflow File
- Create the directory
.github/workflows/in your repository root (if it doesn't exist) - Create a file named
deploy.yml(or any.ymlfile in.github/workflows/) - Add the workflow configuration (see example below)
Example Workflow
Here's a basic example that deploys your application whenever code is pushed to the main branch:
name: Deployment to Andasy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: quarksgroup/andasy-action@main
env:
# Set access token from GitHub secrets
ANDASY_ACCESS_TOKEN: ${{ secrets.ANDASY_ACCESS_TOKEN }}
How this works:
- Trigger - Runs on every push to the
mainbranch - Checkout - Downloads your repository code
- Deploy - Runs
andasy deployusing the action, which builds and deploys your app
Customizing the Workflow
You can customize when deployments run:
# Deploy on push to main or when a release is created
on:
push:
branches: [main]
release:
types: [created]
# Or deploy only on manual trigger
on:
workflow_dispatch:
For more examples and advanced configurations, check andasy-action-examples.
How It Works
When the workflow runs:
- GitHub triggers the workflow - Based on your
on:configuration (push, release, etc.) - Code is checked out - Your repository code is downloaded to the GitHub Actions runner
- Andasy Action runs - The action authenticates using your token and runs
andasy deploy - Application deploys - Your app is built and deployed to Andasy, just like running
andasy deploylocally
The deployment process is identical to running andasy deploy manually, the action just automates it.
Troubleshooting
Deployment Fails
- Check the token - Verify
ANDASY_ACCESS_TOKENis set correctly in GitHub secrets - Check
andasy.hcl- Ensure your configuration file exists and is valid - View workflow logs - Check the Actions tab in GitHub for detailed error messages
- Test locally - Run
andasy deploylocally to ensure it works
Token Issues
- Token expired - Generate a new token with
andasy auth token - Wrong permissions - Ensure the token has access to the organization and application
Related Documentation
- Deploy - Learn about the deployment process
- Authentication - Understand access tokens
- Setup - Set up your application configuration