DB - Save Anonymized DB #41
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: "DB - Save Anonymized DB" | |
on: | |
workflow_dispatch: | |
jobs: | |
save-anonymized-db: | |
runs-on: self-hosted | |
environment: Test | |
steps: | |
- name: Get Environment Name for ${{ vars.ENV_NAME }} | |
id: get_env_name | |
uses: Entepotenz/change-string-case-action-min-dependencies@v1 | |
with: | |
string: ${{ vars.ENV_NAME }} | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Dump database for ${{ vars.ENV_NAME }} | |
run: | | |
cd ./src/anon-tools | |
mkdir -p ./keys | |
echo "${{ secrets.KEY_FILE_PROD }}" > ./keys/key | |
docker build -t dump_image -f Dockerfile.dump . | |
docker run -v ./keys/key:/keys/key --shm-size=2gb --rm \ | |
-e AWS_ACCESS_KEY_ID_PROD=${{ secrets.AWS_ACCESS_KEY_ID_PROD }} \ | |
-e AWS_SECRET_ACCESS_KEY_PROD=${{ secrets.AWS_SECRET_ACCESS_KEY_RPOD }} \ | |
-e AWS_DEFAULT_REGION_PROD=eu-west-1 \ | |
-e AWS_ACCESS_KEY_ID_TEST=${{ secrets.AWS_ACCESS_KEY_ID }} \ | |
-e AWS_SECRET_ACCESS_KEY_TEST=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ | |
-e AWS_DEFAULT_REGION_TEST=eu-west-1 \ | |
-e DATABASE_NAME=opensupplyhub \ | |
-e DATABASE_USERNAME=opensupplyhub \ | |
-e DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }} \ | |
dump_image |