I have set up a GitHub actions workflow, where when I push code to a branch in my repo, GitHub actions help me build an image of that repo and push it to Docker Hub, which work fine.
The thing is that I now have certificate-files that I want to keep locally (i.e. not push up to my GitHub repo) - but that also means that the GitHub actions don't have access to them when building the image, and thus they don't get included in the built image on Docker Hub which I use to pull from into my production server - where I now don't have my certificate files. How can I set up GitHub actions to in some way build the image by using local files? Or is there a better way to solve this?
My GitHub actions file
name: Build and deploy project to Docker Hub
on:
push:
branches:
- master
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub - Main web app container registry
uses: docker/login-action@v1
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Build and push Main web app container image to registry
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.USERNAME }}/project:latest
file: ./Dockerfile.prod