Skip to content

Merge pull request #4 from CentML/gflarity/timeout #17

Merge pull request #4 from CentML/gflarity/timeout

Merge pull request #4 from CentML/gflarity/timeout #17

Workflow file for this run

name: Build, Push Multi-Platform Docker Image to GHCR and Create Release
on:
push:
tags:
- 'v*.*.*' # Triggers 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: Set lowercase repository owner
id: owner
run: |
# Convert the repository owner to lowercase and save it as an output variable.
echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
# Tag the image using the lowercased owner and repository name.
tags: ghcr.io/${{ steps.owner.outputs.owner }}/${{ github.event.repository.name }}:${{ 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)
for platforms: linux/amd64 and linux/arm64.
draft: false
prerelease: false