33 lines
850 B
YAML
33 lines
850 B
YAML
name: Docker
|
|
run-name: Build and Publish Service
|
|
runs-on: ubuntu-latest
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
jobs:
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
-
|
|
name: Set Environment Variables
|
|
id: vars
|
|
env:
|
|
repository: ${{gitea.repository}}
|
|
ref_name: ${{gitea.ref_name}}
|
|
run: |
|
|
echo $repository
|
|
echo ::set-output name=OWNER::${repository#/*}
|
|
echo ::set-output name=PROJECT::${repository#*/}
|
|
echo $ref_name
|
|
echo ::set-output name=TAG::${ref_name#refs/*/}
|
|
-
|
|
name: Push Image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: 192.168.1.2:5000/${{gitea.repository}}:${{steps.vars.outputs.TAG}}
|