Adds login #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Read secrets from vault | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: {} | |
jobs: | |
bash-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install vault-cli | |
run: | | |
sudo apt-get update && sudo apt-get install gpg wget | |
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg | |
echo "wget done" | |
gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint | |
echo "gpg done" | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list | |
echo "echo is done" | |
sudo apt-get update && sudo apt-get install vault | |
- name: RUn docker-compose | |
run: docker compose -f ./vault-docker/docker-compose.yml up -d | |
- name: verifying vault | |
run: | | |
echo "Waiting for Vault to start..." | |
sleep 60 | |
docker ps | |
echo "docker images" | |
docker images | |
echo "export vault addr" | |
export VAULT_ADDR=http://127.0.0.1:8200 | |
echo "vault status" | |
vault status | |
echo "login to vault" | |
vault login token=vault-plaintext-root-token | |
vault status | |
export MYKEY=$(vault kv get -field=MY_PASSWORD /secrets/my-secrets) | |
echo $MKEY | |