hermes/.github/workflows/build.yml

38 lines
No EOL
1.1 KiB
YAML

name: builder
on:
pull_request:
types:
- closed
paths:
- 'VERSION'
workflow_dispatch:
push:
branches: dev
paths:
- VERSION
tags-ignore:
- '*'
jobs:
build:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: checkout
uses: actions/checkout@main
- name: login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: get version
id: get_version
run: |
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: build images
run: |
docker build ./api --tag ghcr.io/greysoh/api:${{ steps.get_version.outputs.version }}
docker push ghcr.io/greysoh/api:latest
docker push ghcr.io/greysoh/api:${{ steps.get_version.outputs.version }}