fix: update workflow name and improve Docker metadata extraction steps
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
name: Create and publish a Docker image for Linux
|
||||
name: Build and publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -6,21 +7,21 @@ on:
|
||||
- master
|
||||
tags:
|
||||
- '*.*.*'
|
||||
workflow_dispatch: # Keep manual trigger for testing
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: gitea.sjs.io
|
||||
GITHUBUSER: ${{ gitea.repository_owner }}
|
||||
IMAGE_NAME: rocky-dev
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
@@ -29,22 +30,26 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ vars.USERNAME }}
|
||||
password: ${{ secrets.PASS }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ vars.USERNAME }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
${{ env.env.GITHUB_REF_NAME }}
|
||||
|
||||
- name: Build and push both architectures
|
||||
# Only tag with version and latest on tag push
|
||||
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
# Optionally, tag dev/master builds with branch name (for testing)
|
||||
type=ref,event=branch,enable=${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
|
||||
Reference in New Issue
Block a user