Migrate config renovate.json5 #39
Workflow file for this run
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: lint-test-build-push | |
| on: | |
| push: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| lint-test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5 | |
| - uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0 | |
| - run: shellcheck *.sh | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: go get . | |
| - name: Test with the Go CLI | |
| run: go test -v ./... | |
| build-push: | |
| needs: [lint-test] | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4 | |
| - name: Extract branch or tag name as docker tag | |
| shell: bash | |
| run: |- | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| TAG=$(echo "${GITHUB_REF#refs/tags/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}') | |
| else | |
| TAG=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}') | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| id: extract_tag | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 | |
| - id: setup | |
| name: Setup docker build | |
| shell: bash | |
| run: |- | |
| # only cache main tag to GHCR | |
| if [ "${{steps.extract_tag.outputs.tag}}" = "main" ]; then | |
| echo "cache-to=type=registry,ref=ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:cache,mode=max" >> $GITHUB_OUTPUT | |
| else | |
| echo "cache-to=" >> $GITHUB_OUTPUT | |
| fi | |
| - name: ghcr Login | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push GHCR | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | |
| with: | |
| platforms: | | |
| linux/amd64 | |
| linux/arm64 | |
| push: true | |
| cache-from: type=registry,ref=ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:cache | |
| cache-to: ${{ steps.setup.outputs.cache-to }} | |
| tags: | | |
| ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:${{steps.extract_tag.outputs.tag}} |