Skip to content

Commit

Permalink
docs/platform: Add brief GitHub Actions page (#16129)
Browse files Browse the repository at this point in the history
I added a small example from the main docs along with some explanation,
and added links to the main docs and the tutorial.

I also took this opportunity to sort the platform left nav bar.
  • Loading branch information
swenson committed Jun 27, 2022
1 parent cf60460 commit 7b88753
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 31 deletions.
46 changes: 46 additions & 0 deletions website/content/docs/platform/github-actions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: docs
page_title: GitHub Actions
description: >-
GitHub Actions
---

# GitHub Actions

Workflows in GitHub Actions can make use of secrets stored in Vault by using a
[`vault-action`](https://github.com/marketplace/actions/vault-secrets) step.

## Example

Here is an example `vault-action` step in a workflow:

```yaml
jobs:
build:
# ...
steps:
# ...
- name: Import Secrets
uses: hashicorp/vault-action@v2.4.0
with:
url: https://vault.example.com:8200
token: ${{ secrets.VAULT_TOKEN }}
caCertificate: ${{ secrets.VAULT_CA_CERT }}
secrets: |
secret/data/ci/aws accessKey | AWS_ACCESS_KEY_ID ;
secret/data/ci/aws secretKey | AWS_SECRET_ACCESS_KEY ;
secret/data/ci npm_token
```

This example will authenticate to Vault instance at `https://vault.example.com:8200` with the GitHub secrets defined in
`VAULT_TOKEN` and `VAULT_CA_CERT`, and will add environment variables available for next steps in the workflow:
- The secret at path `secret/data/ci/aws` with the key `accessKey` available in the environment variable `AWS_ACCESS_KEY_ID`
- The secret at path `secret/data/ci/aws` with the key `secretKey` available in the environment variable `AWS_SECRET_ACCESS_KEY`
- The secret at path `secret/data/ci` with the key `npm_token` available in the environment variable `NPM_TOKEN`

## Further Information

For more information on using the `vault-action` GitHub Action, visit:

- [`vault-secrets` GitHub action documentation](https://github.com/marketplace/actions/vault-secrets)
- [Vault GitHub actions tutorial](https://learn.hashicorp.com/tutorials/vault/github-actions)
71 changes: 40 additions & 31 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,32 @@
"title": "Overview",
"path": "platform"
},
{
"title": "AWS",
"routes": [
{
"title": "Overview",
"path": "platform/aws"
},
{
"title": "Vault Lambda Extension",
"path": "platform/aws/lambda-extension"
},
{
"title": "Running Vault",
"path": "platform/aws/run"
}
]
},
{
"title": "GitHub",
"routes": [
{
"title": "GitHub Actions",
"path": "platform/github-actions"
}
]
},
{
"title": "Kubernetes",
"routes": [
Expand Down Expand Up @@ -1495,65 +1521,48 @@
]
},
{
"title": "AWS",
"routes": [
{
"title": "Overview",
"path": "platform/aws"
},
{
"title": "Vault Lambda Extension",
"path": "platform/aws/lambda-extension"
},
{
"title": "Running Vault",
"path": "platform/aws/run"
}
]
},
{
"title": "ServiceNow",
"title": "Microsoft SQL Server EKM provider",
"routes": [
{
"title": "Overview",
"path": "platform/servicenow"
"path": "platform/mssql"
},
{
"title": "Installation",
"path": "platform/servicenow/installation"
"path": "platform/mssql/installation"
},
{
"title": "Configuration",
"path": "platform/servicenow/configuration"
"path": "platform/mssql/configuration"
},
{
"title": "Upgrading",
"path": "platform/mssql/upgrading"
},
{
"title": "Troubleshooting",
"path": "platform/servicenow/troubleshooting"
"path": "platform/mssql/troubleshooting"
}
]
},
{
"title": "Microsoft SQL Server EKM provider",
"title": "ServiceNow",
"routes": [
{
"title": "Overview",
"path": "platform/mssql"
"path": "platform/servicenow"
},
{
"title": "Installation",
"path": "platform/mssql/installation"
"path": "platform/servicenow/installation"
},
{
"title": "Configuration",
"path": "platform/mssql/configuration"
},
{
"title": "Upgrading",
"path": "platform/mssql/upgrading"
"path": "platform/servicenow/configuration"
},
{
"title": "Troubleshooting",
"path": "platform/mssql/troubleshooting"
"path": "platform/servicenow/troubleshooting"
}
]
}
Expand Down

0 comments on commit 7b88753

Please sign in to comment.