Skip to content

Commit

Permalink
feat: add correct release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timia2109 committed Aug 3, 2024
1 parent f8d0203 commit ae9ae43
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/docker-description.yml

This file was deleted.

45 changes: 31 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
name: Docker Image Build and Publish
name: Release Docker Image

on:
push:
branches:
- main
tags:
- "v*"

env:
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
build-docker-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
- uses: actions/checkout@v4

- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Metadata action
id: docker_metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
name: timia2109/simple-meal-plan
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
#platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}

0 comments on commit ae9ae43

Please sign in to comment.