hermes/.github/workflows/build.yml
2024-05-04 19:36:42 -04:00

35 lines
No EOL
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: build images
run: |
docker build ./api --tag ghcr.io/greysoh/api:$(cat VERSION)
docker tag ghcr.io/greysoh/api:$(cat VERSION) ghcr.io/greysoh/api:latest
docker push ghcr.io/greysoh/api:$(cat VERSION)
docker push ghcr.io/greysoh/api:latest