Skip to content

Update docker-build-push-to-ghcrio.yaml #6

Update docker-build-push-to-ghcrio.yaml

Update docker-build-push-to-ghcrio.yaml #6

name: Build & Publish to ghcr.io
on:
workflow_dispatch:
push:
branches: [main]
# pull_request:
# branches: [main]
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# create a unique tag for each build for debugging
- name: Set Docker tag
id: date
run: echo "DATE_STAMP=$(date +%s)" > "$GITHUB_ENV"
- name: Build and push Docker images
uses: unaimillan/github-action-nixpacks@v0.2.1
with:
push: true
# labels: | # Already exist inside action (not documented)
# org.opencontainers.image.source=https://github.com/${{ github.repository }}
tags: |
${{ env.IMAGE_NAME }}:custom-${{ env.DATE_STAMP }}
${{ env.IMAGE_NAME }}:latest