Comments (4)
Hi @angristan,
Judging from your comment in digitalocean/doctl#630, I think you are looking for the doctl projects resources assign
command.
That said, you can use multiple accounts with this action. Using the token provide as a required argument, a context name default
is created. You can override the account by using the --access-token
flag.
- name: Create Droplet in different account
env:
NEW_TOKEN: ${{ secrets.new_token }}
run: doctl compute droplet create example.com --size s-1vcpu-1gb --image ubuntu-20-04-x64 --region nyc3 --access-token=$NEW_TOKEN
from action-doctl.
Thanks!
I ended up doing as suggested in digitalocean/doctl#630.
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 25d1ad9..09924d3 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -27,9 +27,18 @@ jobs:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Create server
- run: doctl compute droplet create action-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER-${{ matrix.os-image }} --size s-1vcpu-1gb --image ${{ matrix.os-image }} --region lon1 --enable-ipv6 --ssh-keys be:66:76:61:a8:71:93:aa:e3:19:ba:d8:0d:d2:2d:d4
+ run: doctl compute droplet create action-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER-${{ matrix.os-image }} --size s-1vcpu-1gb --image ${{ matrix.os-image }} --region lon1 --enable-ipv6 --ssh-keys be:66:76:61:a8:71:93:aa:e3:19:ba:d8:0d:d2:2d:d4 --wait
- - name: Wait for server to be created
- run: sleep 90
+ - name: Get server ID
+ run: echo ::set-output name=value::$(doctl compute droplet list -o json | jq -r '.[] | select(.name == "'action-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER-${{ matrix.os-image }}'").id')
+ id: server_id
+
+ - name: Move server to dedicated project
+ run: doctl projects resources assign ${{ secrets.DIGITALOCEAN_PROJECT_ID }} --resource=do:droplet:${{ steps.server_id.outputs.value }}
+
+ - name: Wait for server to boot
+ run: sleep 90
- name: Get server IP
from action-doctl.
Glad to see you got it all working!
from action-doctl.
By the way, thanks for action-doctl
! I was pleasantly surprised when I found it. 🙂
from action-doctl.
Related Issues (20)
- Creates a lot of personal access tokens HOT 1
- Unable to apply manifest files using doctl - connection refused HOT 1
- Input required and not supplied: token HOT 1
- Deploy to droplet app HOT 3
- Action will stop working Nov 16th HOT 2
- GitHub Action No Longer Works Due to Deprecation of Add-Path HOT 3
- [SOLVED] `doctl registry login` creates superfluous API Tokens HOT 1
- Access Token always fails authentication HOT 5
- multiple tokens and authentication required HOT 1
- version: latest is installing v1.64.0 instead of 2.1.0 HOT 2
- Usage instructions should have a token setup reminder HOT 2
- Manual input request - how to solve? HOT 1
- Upgrade action to use Node 16
- Setup without token for offline commands such as app spec validation
- Ignore file HOT 1
- Support for arm64 platform HOT 1
- Self hosted runner: os.machine is not a function HOT 5
- Serverless deploy using this action seems to failing with INTERNAL_ERROR HOT 3
- Error: Unable to process command '::add-path::/opt/hostedtoolcache/doctl/1.100.0/x64' successfully. HOT 1
- Warning message "Node 16 deprecated"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-doctl.