32 lines
793 B
YAML
32 lines
793 B
YAML
|
name: Docker Image
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [ "master" ]
|
||
|
tags: [ "v*" ]
|
||
|
pull_request:
|
||
|
branches: [ "master" ]
|
||
|
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v3
|
||
|
- name: Login to Docker Hub
|
||
|
uses: docker/login-action@v2
|
||
|
with:
|
||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
- name: Docker meta
|
||
|
id: meta
|
||
|
uses: docker/metadata-action@v4
|
||
|
with:
|
||
|
images: panpaul/woj-server
|
||
|
- name: Build and Push the Docker Image
|
||
|
uses: docker/build-push-action@v3
|
||
|
with:
|
||
|
push: ${{ github.event_name != 'pull_request' }}
|
||
|
tags: ${{ steps.meta.outputs.tags }}
|
||
|
labels: ${{ steps.meta.outputs.labels }}
|