Skip to content

Commit

Permalink
Use different way for vault import
Browse files Browse the repository at this point in the history
  • Loading branch information
Ancocodet committed Apr 16, 2024
1 parent cbac8cd commit fb138e7
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
outputs:
image: ${{ steps.image_name.outputs.image }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Generate image name
id: image_name
Expand Down Expand Up @@ -39,26 +39,27 @@ jobs:
deployment:
needs: publish
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: 'Checkout' # Checkout the repository code.
uses: 'actions/checkout@v3'
- name: 'Checkout'
uses: 'actions/checkout@v4'

- name: Import Secrets
id: import-secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ secrets.VAULT_ADDR }}
method: userpass
username: ${{ secrets.VAULT_USERNAME }}
password: ${{ secrets.VAULT_PASSWORD }}
secrets: |
applications/aznopoly DISCORD_CLIENT_ID;
applications/aznopoly DISCORD_CLIENT_SECRET
- name: Update arch
run: pacman -Sy archlinux-keyring --noconfirm

- name: Install requirementss
run: |
pacman -Sy kubectl --noconfirm
pacman -Sy helm --noconfirm
pacman -Sy vault --noconfirm
pacman -Sy libcap --noconfirm
pacman -Sy jq --noconfirm
- name: Step following 'Import Secrets'
- name: Deploy
run: |
touch secrets.json
echo '${{ toJson(steps.import-secrets.outputs) }}' >> secrets.json
export VAULT_TOKEN=$(curl --request POST --data "{\"password\": \"$VAULT_PASSWORD\"}" $VAULT_ADDR/v1/auth/userpass/login/$VAULT_USERNAME \
| jq . | jq ."auth"."client_token" | tr -d \")
vault kv get -format json applications/aznopoly | jq ".data.data | {"secrets": .}" > secrets.json
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
Expand Down

0 comments on commit fb138e7

Please sign in to comment.