Skip to content

Commit

Permalink
ci: add github actions builder
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
  • Loading branch information
arthurzam committed May 22, 2024
1 parent 7a4fa55 commit ff0a27f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ci

on:
push:
branches: [master,develop]

jobs:
test-go:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.2
cache-dependency-path: go.sum
- name: Test
run: go test -v ./pkg/models/...

docker:
needs: ["test-go"]
runs-on: ubuntu-latest

strategy:
matrix:
include:
- file: Dockerfile
type: web
- file: Dockerfile.updater
type: updater

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/gentoo/soko
tags: |
type=sha,prefix={{branch}}-${{ matrix.type }}-
type=raw,value={{branch}}-${{ matrix.type }}-latest
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.file }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit ff0a27f

Please sign in to comment.