de.lehmann.devops/.gitea/workflows/publish-docker-nodejs.yaml
2024-09-09 13:53:08 +02:00

35 lines
1.2 KiB
YAML

name: Publish docker nodejs workflow
on:
workflow_call:
jobs:
publish_docker:
name: Build and publish docker image for nodejs
runs-on: docker-ubuntu
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Download build artifacts (dist files)
uses: actions/download-artifact@v3
with:
name: artifacts-build
path: dist/
- name: Setup docker buildx environment
uses: docker/setup-buildx-action@v3
- name: Login to docker registry
uses: docker/login-action@v3
with:
registry: ${{ vars.CONTAINER_REGISTRY_URL }}
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: "${{ vars.CONTAINER_REGISTRY_URL }}/${{gitea.repository}}:latest"
build-args: |
FILE_BINARY=${{ env.APPLICATION_FILE_BINARY }}
NAME_APPLICATION=${{ env.APPLICATION_NAME }}
PORT_EXPOSURE=${{ env.APPLICATION_PORT }}
JAVA_VERSION=${{ env.APPLICATION_JAVA_VERSION }}