Skip to content

Build and publish Docker image #69

Build and publish Docker image

Build and publish Docker image #69

Workflow file for this run

name: Build and publish Docker image
on:
schedule:
- cron: "37 13 * * 1"
workflow_run:
workflows: [ "Luarocks Release" ]
types: [ completed ]
# push:
# branches: [ "main" ]
# tags: [ "v*" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} # <account>/<repo>
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule,pattern=nightly
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- uses: docker/build-push-action@v6
with:
context: examples/advanced
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}