Skip to content

Update gomod updates #177

Update gomod updates

Update gomod updates #177

Workflow file for this run

name: lint-test
on: [push]
permissions:
contents: read
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6
with:
version: latest
- name: Install dependencies
run: go get .
- name: Build
run: shellcheck **/*.sh
- name: Build
run: go build
- name: Test with the Go CLI
run: go test -v ./...
build-push:
needs: [lint-test]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4
- name: Extract branch name
shell: bash
run: |-
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^a-zA-Z0-9._-]//g' | awk '{print substr($0, length($0)-120)}')
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
id: extract_branch
- name: Extract tag name
shell: bash
run: |-
t=$(echo ${GITHUB_SHA} | cut -c1-7)
echo "tag=$t" >> $GITHUB_OUTPUT
id: extract_tag
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@3a3c4c57d294ef65efaaee4ff17b22fa88dd3c69' # v1
with:
workload_identity_provider: ${{ secrets.GCLOUD_OIDC_POOL }}
create_credentials_file: true
service_account: ${{ secrets.GSA }}
token_format: 'access_token'
- uses: 'docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567' # v3
name: 'Docker login'
with:
registry: 'us-docker.pkg.dev'
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
- name: Build and push
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
push: true
tags: |
us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/public/fabricator:${{steps.extract_branch.outputs.branch}}-${{steps.extract_tag.outputs.tag}}
us-docker.pkg.dev/${{ secrets.GCLOUD_PROJECT }}/public/fabricator:${{steps.extract_branch.outputs.branch}}