Docs/feature/modify readme #94
Workflow file for this run
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: Backend Build | |
on: | |
pull_request: | |
types: [opened, edited] | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.base.ref == 'dev' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Generate .env file | |
run: echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Setup docker-compose | |
uses: KengoTODA/actions-setup-docker-compose@v1.2.1 | |
with: | |
version: "2.24.5" | |
- name: Create a Builder Instance | |
run: | | |
docker buildx create --name buildx | |
docker buildx use buildx | |
- name: Build & Push Docker Cache | |
run: | | |
cp package.json backend/package.json | |
cp package-lock.json backend/package-lock.json | |
cp -r packages backend/packages | |
cd backend | |
docker-compose -f compose.cache-export.yml build --builder buildx --build-arg BUILDKIT_INLINE_CACHE=1 | |
docker-compose -f compose.cache-export.yml push |