You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
VTEX Toolbelt Action
v4
This GitHub action deploys the VTEX Toolbelt and can do log in using KEY/TOKEN. It can be useful to automate you CI/CD pipelines or just to schedules day-to-day tasks like cleaning dirty workspaces.
- Deploy VTEX Toolbelt (you can customize the repository/branch)
- Change the tool name, i.e. instead of
vtex
it can go byvtex-e2e
- Login using
app key
andapp token
- Cache resources to do the next deploy faster
- Check every step and stop if anything goes wrong
# toolbelt-workflow.yml
name: [QE] Deploy Toolbelt
on:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
deploy:
name: Toolbelt deploy and login
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Deploy toolbelt
uses: vtex/action-toolbelt@v4
If you want to log in, please, add two secrets on your repository secrets:
- One for the app key, in our example it is
VTEX_TOOLBELT_KEY
- Other for the token, in our example it is
VTEX_TOOLBELT_TOKEN
Next you need to set up your workflow like the example bellow, and that's it.
# toolbelt-workflow.yml
name: [QE] Deploy Toolbelt
on:
push:
branches:
- master
- main
workflow_dispatch:
jobs:
deploy:
name: Toolbelt deploy and login
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Deploy toolbelt and login
uses: vtex/action-toolbelt@v4
with:
account: YOUR_ACCOUNT
appKey: ${{ secrets.VTEX_TOOLBELT_KEY }}
appToken: ${{ secrets.VTEX_TOOLBELT_TOKEN }}
authenticate: true # defaults to true, but it'll be false if
# any of account, appKey or appToken is missing
workspace: master # defaults to master if omitted
bin: vtex-e2e # defaults to vtex-e2e if omitted
git: vtex/toolbelt # defaults to vtex/toolbelt if omitted
branch: qe/cypress # defaults to qe/cypress if omitted
- name: Do something after the login
run: vtex-e2e workspace ls
# The call name bellow must be the same given as *with: bin*
- name: Logout'
run: vtex-e2e logout
# Not needed, the .vtex folder isn't saved on cache
The output of this workflow will be something like that:
::notice title=Toolbelt version used::vtex/3.0.0 linux-x64 node-v16.13.0 [from https://github.com/vtex/toolbelt/tree/]
===> Fetching VTEX token... done.
===> Creating session.json... done.
===> Creating workspace.json... done.
===> Checking authentication... done.
14:01:15.234 - info: Logged into account as vtexkey-account-ABC at production workspace master
This action was made based on this issue discussion inspiration and I'll give my thanks to:
- rod-dot-codes for bridging the question and do a Python version of the script
- cantoniazzi for giving the direction to do it using only cURL
- achirus-code for making a version in Bash that inspired this action
Together we can do more!