I tried a lot of shit so its a lot of commit messages. But basicly
secrets: API= ${{ secrets.API_KEY }}
this line tranfers the API_KEY github secret into a secret docker variable API
RUN --mount=type=secret,id=API,target=/usr/app/src/secret cat /usr/app/src/secret > ./secretfile.txt
we ask docker in this line to search for the secret variable API and store it somewhere for this line. than we make a text file and put out API variable inside.
I know this is still stored in plain text inside of the docker container but I may have some ideas to fix that in the future if needed. By doing arguments to main. so u can do CMD [ "python","./main.py","cat /usr/app/src/secret"]
I tried a lot of shit so its a lot of commit messages. But basicly
this line tranfers the
API_KEY
github secret into a secret docker variableAPI
we ask docker in this line to search for the secret variable
API
and store it somewhere for this line. than we make a text file and put outAPI
variable inside.