I try to create a custom docker container in GitHub action, but I can't reach my repo files.
I have this .github/workflows/workflow.yml:
name: Workflow
on:
push:
branches:
- my-test-branch
jobs:
testjob:
runs-on: ubuntu-20.04
name: My test job
steps:
- name: Checkout
uses: actions/checkout@v3
- name: My Custom Action
uses: ./.github/actions/my-custom-action
The .github/actions/my-custom-action/action.yml file contains this:
name: Docker container test
description: Start container
runs:
using: docker
image: ./php.dockerfile
In the .github/actions/my-custom-action/php.dockerfile contains this:
FROM php:8.1-fpm-alpine
WORKDIR /var/www/html
# here I want to use COPY or ADD to attach the directory to the Docker container
I checked GitHub documentation, but nothing was found about this topic. I browsed several Stackoverflow and GitHub issues and tried some tips, but nothing useful.
How can I access repository files from the Docker container?