Merge pull request #146 from cmahnke/dependabot/github_actions/github… #235
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: OAI PMH Harvester GitHub Packages | |
permissions: | |
packages: write | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint_harvester: | |
name: Lint PHP code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: composer | |
- name: Run Composer | |
working-directory: ./harvester | |
run: composer install --dev --no-scripts --no-interaction | |
- name: Run linter | |
working-directory: ./harvester | |
run: composer run lint | |
build_harvester: | |
name: Push to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
with: | |
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/harvester | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./docker/harvester/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build_converter: | |
name: Push to GitHub Packages | |
needs: build_harvester | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Log in to the Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
logout: false | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
with: | |
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=10485760 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/converter | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Push to GitHub Packages | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./docker/converter/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |