Enabled GitHub Actions to publish image
parent
e01238fc10
commit
1f5a04414a
|
@ -0,0 +1,39 @@
|
|||
name: Publish Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['master']
|
||||
tags: ['*']
|
||||
|
||||
env:
|
||||
DOCKER_HUB_USER: phlak
|
||||
|
||||
jobs:
|
||||
build-container:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ env.DOCKER_HUB_USER }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Extract Metadata
|
||||
id: extract-metadata
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ${{ env.DOCKER_HUB_USER }}/minecraft
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Build & Push Image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
push: true
|
||||
tags: ${{ steps.extract-metadata.outputs.tags }}
|
||||
labels: ${{ steps.extract-metadata.outputs.labels }}
|
Loading…
Reference in New Issue