Skip to content

ci(gha): workflows for planetscale fork #2

ci(gha): workflows for planetscale fork

ci(gha): workflows for planetscale fork #2

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: write
packages: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4
- name: Build
run: go build -v -trimpath .
- name: test
run: go test -v -cover .
release:
#if: github.ref == 'refs/heads/main'
needs: [test]
runs-on: ubuntu-latest
# only create a release on main builds:
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
# - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
# with:
# go-version-file: go.mod
# - name: install autotag binary
# run: |
# curl -sL https://git.io/autotag-install | sudo sh -s -- -b /usr/local/bin
# - name: Install GoReleaser
# uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
# with:
# install-only: true
- name: login to ghcr.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: VERSION=todo
# build-args: VERSION=${{ steps.docker_meta.outputs.version }}
platforms: linux/amd64,linux/arm64
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.docker_meta.outputs.tags }}
# labels: ${{ steps.docker_meta.outputs.labels }}