another try?

This commit is contained in:
2023-09-22 11:20:21 +02:00
committed by T.v.Dein
parent 3b465b5ea7
commit 68e1d1eefe

View File

@@ -1,38 +1,18 @@
# name: publish
name: build-push-docker-image on: [push]
on:
push:
branches: ['development']
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
build-and-push-image: publish-ephemeruo-image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- name: Checkout repository - uses: actions/checkout@v2
uses: actions/checkout@v4 - name: Login to GitHub Container Registry
- name: Log in to the Container registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ${{ env.REGISTRY }} registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker - name: build-push-image
id: meta run: |
uses: docker/metadata-action@v1 docker build . --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
with: docker run ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Build and push Docker image
uses: docker/build-push-action@v1
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}