Skip to content

Added a build step

Added a build step #2

Workflow file for this run

name: Docker image
on:
push:
branches:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- '*'
jobs:
build:
name: Build & push docker image
runs-on: self-hosted
steps:
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=dev-{{date 'YYYYMMDDhhmm'}}.{{sha}},enable=${{ github.ref_type != 'tag' }}
- name: Docker Build
steps:
- run: docker build -t test .
# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# cache-from: type=gha
# cache-to: type=gha,mode=max
# context: .
# push: ${{ startsWith(github.ref, 'refs/tags/') }}
# tags: ${{ steps.metadata.outputs.tags }}
# labels: ${{ steps.metadata.outputs.labels }}
#
# - name: Create release
# uses: josephrodriguez/[email protected]
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}