This uploads an artifact from your workflow to google drive allowing you to store data once a workflow is complete.
See action.yml for a description of all valid parameters.
steps:
- uses: actions/checkout@v2
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: Ecks1337/upload-artifact-gdrive@master
with:
name: my-artifact.txt
path: path/to/artifact/world.txt
parentId: 17G4HkZu_CJmZdsl1aui40ANHrjSOhlYf
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
You can upload an artifact without specifying the id of a parent folder
- uses: Ecks1337/upload-artifact-gdrive@master
with:
name: my-artifact.txt
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
If the id of the parent folder isn't provided, the file will be uploaded into the root of the "MyDrive" folder.
You can upload an artifact without specifying a name
- uses: Ecks1337/upload-artifact-gdrive@master
with:
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
If the artifact name isn't provided, the name of the file will be used as the name of the artifact.
- uses: Ecks1337/upload-artifact-gdrive@master
with:
replaceId: 2i7RuQwKzuZr-DNxNiooHfVMwIJLdjf-H
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
- uses: Ecks1337/upload-artifact-gdrive@master
with:
replaceId: 2i7RuQwKzuZr-DNxNiooHfVMwIJLdjf-H
parentId: 17G4HkZu_CJmZdsl1aui40ANHrjSOhlYf
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
The action returns the Google id of the artifact that has been uploaded to Google Drive
steps:
- name: Upload artifact to google drive
id: uniqueStepId
uses: Ecks1337/upload-artifact-gdrive@master
with:
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN
- name: Get the Google file id
run: echo "The id is ${{ steps.uniqueStepId.outputs.fileId }}"
To upload artifacts only when the previous step of a job failed, use if: failure()
:
- uses: Ecks1337/upload-artifact-gdrive@master
if: failure()
with:
path: path/to/artifact/world.txt
client_secret: $SECRET
client_id: $CLIENT_ID
token: $TOKEN
refresh_token: $REFRESH_TOKEN