Skip to content

Merge branch 'feature/svg_refactor_2.0' into next #5

Merge branch 'feature/svg_refactor_2.0' into next

Merge branch 'feature/svg_refactor_2.0' into next #5

name: Build And Release
on:
push:
branches:
- 'next'
jobs:
build_and_release_nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: Build
run: |
mkdir artifacts
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o artifacts/ plavatar/cmd/plavatar
- name: Test
run: go test -v -cover ./...
- name: Release Artifact
uses: actions/upload-artifact@v2
with:
name: plavatar
path: artifacts/plavatar
- name: Authenticate Docker
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase Repository Identifiers
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo IMAGE_TAG=$(echo ${{ github.ref }} | tr '[:upper:]' '[:lower:]' | awk '{split($0,a,"/"); print a[3]}') >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/{{ env.IMAGE_REPOSITORY }}
- name: Release Docker
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .