Skip to content

fix: bad Dockerfile workdir timing + copy in license (#614) #6

fix: bad Dockerfile workdir timing + copy in license (#614)

fix: bad Dockerfile workdir timing + copy in license (#614) #6

name: publish docker image
on:
release:
types: [published]
push:
branches:
- dev
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up dev (edge) image metadata
id: meta-dev
uses: docker/metadata-action@v5
if: ${{ github.event_name != 'release' }}
with:
images: |
${{ inputs.image-name }}
flavor: |
latest=false
tags: |
type=raw,value=dev,enable={{is_default_branch}}
type=sha,prefix=sha-
- name: Set up release image metadata
id: meta-release
uses: docker/metadata-action@v5
if: ${{ github.event_name == 'release' }}
with:
images: ghcr.io/idoneam/Canary
flavor: |
latest=true
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}}
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push dev (edge) image
uses: docker/build-push-action@v6
if: ${{ github.event_name != 'release' }}
with:
context: .
push: true
tags: ${{ steps.meta-dev.outputs.tags }}
- uses: docker/build-push-action@v6
if: ${{ github.event_name == 'release' }}
with:
context: .
push: true
tags: ${{ steps.meta-release.outputs.tags }}