1.5.1 #16
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: Release docker image | |
on: | |
release: | |
type: [ create, edited ] | |
push: | |
branches: | |
- main | |
env: | |
registry: ghcr.io | |
image: ${{ github.actor }}/pichi | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to the Container Registry | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ${{ env.registry }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & Publish Docker Image with Version | |
if: ${{ github.event_name == 'release' }} | |
uses: docker/build-push-action@v3.2.0 | |
with: | |
context: . | |
file: docker/pichi.dockerfile | |
push: true | |
tags: ${{ env.registry }}/${{ env.image }}:${{ github.ref_name }} | |
- name: Build & Publish latest Docker Image | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/build-push-action@v3.2.0 | |
with: | |
context: . | |
file: docker/pichi.dockerfile | |
push: true | |
tags: ${{ env.registry }}/${{ env.image }}:latest |