Publish Docker Image on Release #5
Workflow file for this run
This file contains 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: Publish Docker Image on Release | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build-and-push: | |
name: Build and Push Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Log in to GitHub Container Registry | |
uses: docker/#-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Set Lowercase Repository Info | |
id: repo_info | |
run: | | |
echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
echo "REPO_NAME=$(echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/$REPO_OWNER/$REPO_NAME:latest | |
ghcr.io/$REPO_OWNER/$REPO_NAME:${{ github.event.release.tag_name }} | |
labels: | | |
org.opencontainers.image.title=fortsphere | |
org.opencontainers.image.description="Fortify your digital sphere, one command at a time." | |
org.opencontainers.image.url=https://github.com/OpenPathfinder/fortSphere | |
org.opencontainers.image.source=https://github.com/OpenPathfinder/fortSphere.git | |
org.opencontainers.image.version=${{ github.event.release.tag_name }} | |
org.opencontainers.image.licenses=MIT | |
maintainer="Ulises Gascón <ulises@linux.com>" |