missed github action for releases #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Push Docker Image to GHCR and Create Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Trigger on tags like v1.0.0, v2.3.4, etc. | |
jobs: | |
build-and-push: | |
name: Build and Push Docker Image to GHCR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
# This tag will use the GitHub Container Registry namespace: ghcr.io/<owner>/<image>:<tag> | |
tags: ghcr.io/${{ github.repository_owner }}/your-docker-repo:${{ github.ref_name }} | |
create_release: | |
name: Create GitHub Release | |
runs-on: ubuntu-latest | |
needs: build-and-push | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
body: | | |
Docker image built and pushed to GitHub Container Registry (ghcr.io). | |
draft: false | |
prerelease: false |