Skip to content

Instantly share code, notes, and snippets.

@gitrgoliveira
Created December 6, 2021 14:38
Show Gist options
  • Save gitrgoliveira/ad414a00fd0041cb1c090eba47f13d1f to your computer and use it in GitHub Desktop.
Save gitrgoliveira/ad414a00fd0041cb1c090eba47f13d1f to your computer and use it in GitHub Desktop.
a GitHub Action that read from Vault and builds a docker image.
name: ImageBuilder
# Run this workflow every time a new commit pushed to your repository
on:
push:
workflow_dispatch:
jobs:
build:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
# runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Import Secrets
uses: hashicorp/vault-action@v2.4.0
with:
url: https://vault-cluster.vault.11eab575-aee3-cf27-adc9-0242ac11000a.aws.hashicorp.cloud:8200
namespace: admin
method: jwt
role: demo
tlsSkipVerify: false
secrets: |
kv/data/ci app_secret | APP_SECRET
- name: Build Docker Image
run: docker build . --file Dockerfile --build-arg app_secret="${{ env.APP_SECRET }}" -t vault-action-exampleapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment