friends-api/.forgejo/workflows/build.yml

23 lines
716 B
YAML
Raw Normal View History

name: Build friends-api
on:
push:
jobs:
build-and-push:
runs-on: docker
steps:
- name: Build friends-api binary
run: |
bun install --frozen-lockfile --production
bun build ./index.js --compile --minify --outfile friends-api
- name: Build and push docker image
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login "${{ gitea.server_url }}" -u "${{ gitea.actor }}" --password-stdin
IMAGE_BASE="${{ gitea.server_url }}/${{ gitea.repository }}"
docker build -t "${IMAGE_BASE}:latest" -t "${IMAGE_BASE}:${{ gitea.sha }}" .
docker push "${IMAGE_BASE}:latest"
docker push "${IMAGE_BASE}:${{ gitea.sha }}"