@@ -12,14 +12,14 @@ jobs:
1212 steps :
1313 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1414
15- - uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
15+ - uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
1616
1717 - uses : hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
1818
1919 - run : shellcheck *.sh
2020
2121 - name : golangci-lint
22- uses : golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7
22+ uses : golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7
2323 with :
2424 version : latest
2525
3131
3232 build-push :
3333 needs : [lint-test]
34- runs-on : ubuntu-24.04
35- timeout-minutes : 15
36- steps :
37- - uses : " actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4
38-
39- - name : Extract branch or tag name as docker tag
40- shell : bash
41- run : |-
42- if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
43- TAG=$(echo "${GITHUB_REF#refs/tags/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}')
44- else
45- TAG=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}')
46- fi
47-
48- echo "tag=$TAG" >> $GITHUB_OUTPUT
49- id : extract_tag
50-
51- - name : Set up QEMU
52- uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
53-
54- - name : Set up Docker Buildx
55- uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
56-
57- - id : setup
58- name : Setup docker build
59- shell : bash
60- run : |-
61- # only cache main tag to GHCR
62- if [ "${{steps.extract_tag.outputs.tag}}" = "main" ]; then
63- echo "cache-to=type=registry,ref=ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:cache,mode=max" >> $GITHUB_OUTPUT
64- else
65- echo "cache-to=" >> $GITHUB_OUTPUT
66- fi
67-
68- - name : ghcr Login
69- uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
70- with :
71- registry : ghcr.io
72- username : ${{ github.actor }}
73- password : ${{ secrets.GITHUB_TOKEN }}
74-
75- - name : Build and push GHCR
76- uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
77- with :
78- platforms : |
79- linux/amd64
80- linux/arm64
81- push : true
82- cache-from : type=registry,ref=ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:cache
83- cache-to : ${{ steps.setup.outputs.cache-to }}
84- tags : |
85- ghcr.io/lehigh-university-libraries/isle-fcrepo-fs:${{steps.extract_tag.outputs.tag}}
34+ uses : lehigh-university-libraries/gha/.github/workflows/build-push-ghcr.yaml@main
35+ permissions :
36+ contents : read
37+ packages : write
38+ secrets : inherit
0 commit comments