Skip to content

Commit

Permalink
Release job
Browse files Browse the repository at this point in the history
  • Loading branch information
strideynet committed Oct 14, 2023
1 parent 721488f commit 9acb252
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 60 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
branches:
- main
tags:
- "v*.*.*"
jobs:
build-and-push-docker:
name: Build and push Docker image
Expand Down Expand Up @@ -33,7 +31,6 @@ jobs:
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=semver,pattern=v{{version}}
type=sha
- name: Build and push
uses: docker/build-push-action@v4
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy
on:
release:
types: [released]
jobs:
build-and-push-docker:
name: Build and push Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docker tags
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}/bffsrv
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern=v{{version}}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
context: .
file: bffsrv.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy-kubernetes:
needs: [build-and-push-docker]
name: Deploy Kubernetes
environment: production
runs-on: ubuntu-latest
steps:
- run: echo wahoo
52 changes: 0 additions & 52 deletions .github/workflows/lint.yaml

This file was deleted.

54 changes: 49 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Tests

name: Lint and Test
on:
push:
branches: [main]
pull_request:

jobs:
go:
test-go:
name: "Test Go"
services:
dind:
image: docker:23.0-rc-dind-rootless
ports:
- 2375:2375
name: "Go: Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -22,4 +21,49 @@ jobs:
- name: Test
run: go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
lint-go:
name: Lint Go
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --timeout=5m
check-sqlc:
name: Check sqlc generation
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: false
- name: Install sqlc
run: go install github.com/kyleconroy/sqlc/cmd/[email protected]
- run: sqlc generate
- name: Check that sqlc queries are up-to-date
run: git diff --exit-code
lint-sql:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.8"
- name: Install sqlfluff
run: "pip install sqlfluff==2.3.2"
- name: Lint sql files
run: "sqlfluff lint"

1 comment on commit 9acb252

@vercel
Copy link

@vercel vercel bot commented on 9acb252 Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.