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: ghcr.io
registry: ${{ env.REGISTRY }} username: ${{ github.actor }}
username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }} - name: build-push-image
- name: Extract metadata (tags, labels) for Docker run: |
id: meta docker build . --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
uses: docker/metadata-action@v1 docker run ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
with: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- 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 }}