chore(deps): update postgres:13.21 docker digest to 15a9132 (#397) #954
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: Build | |
on: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
# true when a push on the main branch | |
PUSH_ARTIFACT: | | |
${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request' }} | |
GO_VERSION: "1.24.1" | |
GOLANGCI_LINT_VERSION: "v2.0.2" | |
jobs: | |
linters: | |
runs-on: ubuntu-latest | |
name: linters | |
permissions: | |
contents: read # Required: allow read access to the content for analysis. | |
pull-requests: read # Optional: allow read access to pull request. | |
checks: write # Optional: allow write access to checks to allow the action to annotate code in the PR. | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
- uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1 | |
with: | |
version: ${{ env.GOLANGCI_LINT_VERSION }} | |
- name: Lint Dockerfile | |
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0 | |
with: | |
dockerfile: "Dockerfile" | |
mod-tidy: | |
name: mod-tidy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: set up go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
id: go | |
- name: go mod tidy | |
run: go mod tidy | |
- run: | | |
if ! git diff --exit-code -- go.mod go.sum; then | |
echo "Modules not tidy; please run 'go mod tidy'" | |
exit 1 | |
fi; | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
needs: [mod-tidy, linters] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
- name: set up go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: true | |
id: go | |
- run: go version | |
- name: Promu | |
run: make promu | |
- name: Build | |
run: make build | |
container: | |
runs-on: ubuntu-latest | |
needs: [linters, mod-tidy, build] | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
with: | |
install: true | |
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 | |
id: metadata | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha,prefix=sha-,format=long | |
type=ref,event=pr | |
type=ref,event=tag | |
type=semver,pattern={{version}} | |
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: ${{ env.PUSH_ARTIFACT }} | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} |