I have a repo I created whose sole purpose is to create a Docker container action that connects to a database (Snowflake) and outputs some data.
I drew heavily from this repo and was able to recreate locally in Docker.
Part of the set up uses a config file. Anyone in our org using this repo will need their own config file. On the repo linked above you can see this in the connection-test.sh script where row 5 uses a custom config file.
I’m trying to figure out the equivalent of doing this with gh actions where I have a repo that contains the base image or action, and then in another repo I want to checkout the snowsql action and then when run use a custom config file that I have in my repo that uses the action.
- ourorg/snowsql # the generic docker container action repo
When I set this up just using Docker on local I have a docker-compose file of the form:
volumes: - ./ssql/config:/home/snowflake/.snowsql/config
Is there an equivalent or ‘right’ way to do this using a custom docker action?
ourorg/my-project-that-uses-snowsql.github/workflows/main.yml looks like this:
on: [push] jobs: ssql_job: runs-on: ubuntu-latest name: Build ssql image steps: - name: Checkout # To use this repository's private action, you must check out the repository uses: actions/checkout with: # Aside, never done this before, don't know if it's right repository: ourorg/ds-ssql-gh-action ref: main - name: Build uses: ./ # Uses an action in the root directory
If this repo
ourorg/ds-ssql-gh-action has a file
./config and after I checkout
ourorg/ds-ssql-gh-action I’d like to run the action / container but before doing so I want to add
ourorg/my-project-that-uses-snowsql/config inside the action / container at
/home/snowflake/.snowsql/config. LIke with a volume mount in docker-compose.
How can I do this?