Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kun bygg hvis endringer i gitt docker-fil #45

Open
arnfinn opened this issue Feb 5, 2024 · 1 comment · Fixed by #47
Open

Kun bygg hvis endringer i gitt docker-fil #45

arnfinn opened this issue Feb 5, 2024 · 1 comment · Fixed by #47

Comments

@arnfinn
Copy link
Contributor

arnfinn commented Feb 5, 2024

Ved ny release, f.eks., vil det være mest hensiktsmessig at kun Docker-image som er endret får en ny release-tag. Mulig dorny/path-filter kunne vært brukt.

Noe ala dette:

jobs:
  # JOB to run change detection
  changes:
    runs-on: ubuntu-latest
    # Required permissions
    permissions:
      pull-requests: read
    outputs:
      # Expose matched filters as job 'packages' output variable
      packages: ${{ steps.filter.outputs.changes }}
    steps:
    # For pull requests it's not necessary to checkout the code
    - uses: dorny/paths-filter@v3
      id: filter
      with:
        filters: |
          package1: src/package1
          package2: src/package2

  # JOB to build and test each of modified packages
  build:
    needs: changes
    strategy:
      matrix:
        # Parse JSON array containing names of all filters matching any of changed files
        # e.g. ['package1', 'package2'] if both package folders contains changes
        package: ${{ fromJSON(needs.changes.outputs.packages) }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - ...
arnfinn added a commit that referenced this issue Feb 5, 2024
Only build image if docker file has been modified.

Closes #45
arnfinn added a commit that referenced this issue Feb 5, 2024
Only build image if docker file has been modified.

Closes #45
@arnfinn
Copy link
Contributor Author

arnfinn commented Feb 6, 2024

Fungerer ikke for publiseringer i dag. Mulig det heller ikke fungerer for cron-jobber.

@arnfinn arnfinn reopened this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant