image publish #9
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: image publish | |
on: | |
push: | |
branches-ignore: | |
- '**' | |
tags: | |
- '**' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'the tag to publish and possibly overwrite' | |
default: 'dev' | |
required: false | |
env: | |
DOCKER_IMAGE_NAME: ghcr.io/WIPACRepo/SkyDriver | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
${{ env.DOCKER_IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
# branches (PRs) | |
type=raw,value=${{ github.event.inputs.tag || '\{\{sha\}\}' }},enable=${{ github.ref_type == 'branch' }} | |
# release tags | |
type=semver,pattern={{major}},enable=${{ github.ref_type == 'tag' }} | |
type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }} | |
type=semver,pattern={{major}}.{{minor}}.{{patch}},enable=${{ github.ref_type == 'tag' }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} |