Securely manage secrets in GitHub Actions workflows using XtraSecurity.
XTRA_API_KEYname: Deploy
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fetch secrets
env:
XTRA_API_KEY: ${{ secrets.XTRA_API_KEY }}
run: |
npm install -g @xtrasecurity/cli
xtra get database_url > $GITHUB_ENV
xtra get api_key >> $GITHUB_ENV
- name: Deploy
run: npm run deploy
name: Production Deployment
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Get secrets
env:
XTRA_API_KEY: ${{ secrets.XTRA_API_KEY }}
run: |
npm install -g @xtrasecurity/cli
xtra get test_db_url > .env.test
xtra get stripe_test_key >> .env.test
- name: Run tests
run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get production secrets
env:
XTRA_API_KEY: ${{ secrets.XTRA_API_KEY }}
run: |
npm install -g @xtrasecurity/cli
export DATABASE_URL=$(xtra get prod_database_url)
export API_KEY=$(xtra get stripe_live_key)
- name: Deploy to production
run: npm run deploy:prod
Integrate XtraSecurity with Docker and Docker Compose. Securely manage container secrets without hardcoding in Dockerfile.
Use XtraSecurity as a secrets provider in Kubernetes. External Secrets Operator integration for automatic secret syncing.
Integrate XtraSecurity secrets with Jenkins pipelines. Secure your Jenkins CI/CD with declarative and scripted pipelines.