Github Actions is a CI/CD platform which allows to use different plugins, or "actions", to perform tasks. And this action allows you to deploy the build artifact to Dropbox.

Setup the action

First, you have to create a new Developer Application in Dropbox and obtain an access token for your Dropbox account.

You can follow this guide to get token.

After that, you need to go to your repository settings, open "Secrets" tab and create a new secret called, such as: DROPBOX_ACCESS_TOKEN and set its values to the token you've got from Dropbox.

Usage

In your workflow add the following code:

- name: Upload to Dropbox
  uses: rensatsu/deploy-to-dropbox@master
  with:
    DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }}
    GLOB: dist/*
    FILE_WRITE_MODE: overwrite

If you've set a different variable name, don't forget to change it in the code as well.

A path to the files you want to upload is defined in variable GLOB - a glob pattern of files to upload.

You can read more details about these variables in the project README.

Source Code

You can access the source code of this action on GitHub.

Copyright

This project is licensed under MIT License.

This project is a fork of aTable/deploy-to-dropbox.