mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-17 03:23:58 +02:00
Added Publish Image workflow
This commit is contained in:
40
.github/workflows/publish-image.yaml
vendored
Normal file
40
.github/workflows/publish-image.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Publish Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['master']
|
||||
tags: ['*']
|
||||
|
||||
env:
|
||||
DOCKER_HUB_USER: phlak
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
name: Build & Push
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ env.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Extract Metadata
|
||||
id: extract-metadata
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.DOCKER_HUB_USER }}/directory-lister
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Build & Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.extract-metadata.outputs.tags }}
|
||||
labels: ${{ steps.extract-metadata.outputs.labels }}
|
Reference in New Issue
Block a user