fix documentation gh action #738
This file contains hidden or 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: docker-importer-actions-workflow | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| # setuptools-scm needs the full history and tags to derive a version | |
| fetch-depth: 0 | |
| - | |
| name: Derive version from git tags | |
| id: scm | |
| run: | | |
| python -m pip install --quiet setuptools-scm | |
| echo "version=$(python -m setuptools_scm)" >> "$GITHUB_OUTPUT" | |
| - | |
| name: Resolve mardiclient revision | |
| id: mc | |
| run: | | |
| echo "sha=$(git ls-remote https://github.com/MaRDI4NFDI/mardiclient.git refs/heads/main | cut -f1)" >> "$GITHUB_OUTPUT" | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - | |
| name: Log in to the Container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - | |
| name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - | |
| name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| SETUPTOOLS_SCM_PRETEND_VERSION=${{ steps.scm.outputs.version }} | |
| MARDICLIENT_REF=${{ steps.mc.outputs.sha }} | |
| provenance: false | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |