Skip to content

Test

Test #6

Workflow file for this run

name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
ACCOUNT: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
jobs:
build:
runs-on: ubuntu-latest
container: docker:git
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: resolve paths-filter error
run: git config --global --add safe.directory /__w/${REPOSITORY}/${REPOSITORY}
- name: detect build file changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
buildfiles:
- project/*
- Dockerfile
- requirements.txt
- tests/requirements-test.txt
- name: build & push image to registry
if: steps.filter.outputs.buildfiles == 'true'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $ACCOUNT --password-stdin
docker build -t ghcr.io/${ACCOUNT}/${REPOSITORY} .
docker push ghcr.io/${ACCOUNT}/${REPOSITORY}