Skip to content

fx ISOstringize

fx ISOstringize #2

name: Docker(nicochuu)
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: Dockerfile
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: image_tag
name: Determine image tag
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
result-encoding: string
script: |
if (context.eventName === "push" && context.ref.startsWith("refs/tags/v"))
return context.ref.substring(11)
else
return "latest"
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: Dockerfile
push: ${{ steps.image_tag.outputs.result != 'latest' }}
tags: ghcr.io/${{ github.repository_owner }}/nicochuu:${{ steps.image_tag.outputs.result }}