|
|
@ -1,10 +1,12 @@ |
|
|
|
name: Docker image CD |
|
|
|
|
|
|
|
on: |
|
|
|
workflow_dispatch: |
|
|
|
push: |
|
|
|
tags: |
|
|
|
- '*.*.*' |
|
|
|
pull_request: |
|
|
|
branches: |
|
|
|
- 'master' |
|
|
|
|
|
|
|
jobs: |
|
|
|
build_and_push: |
|
|
@ -13,6 +15,16 @@ jobs: |
|
|
|
- name: Checkout code |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: Docker metadata |
|
|
|
id: meta |
|
|
|
uses: docker/metadata-action@v4 |
|
|
|
with: |
|
|
|
images: grobut939/ghostfolio |
|
|
|
tags: | |
|
|
|
type=ref,event=pr |
|
|
|
type=semver,pattern={{version}} |
|
|
|
type=semver,pattern={{major}}.{{minor}} |
|
|
|
|
|
|
|
- name: Set up QEMU |
|
|
|
uses: docker/setup-qemu-action@v2 |
|
|
|
|
|
|
@ -21,6 +33,7 @@ jobs: |
|
|
|
uses: docker/setup-buildx-action@v2 |
|
|
|
|
|
|
|
- name: Login to DockerHub |
|
|
|
if: github.event_name != 'pull_request' |
|
|
|
uses: docker/login-action@v2 |
|
|
|
with: |
|
|
|
username: ${{ secrets.DOCKER_USERNAME }} |
|
|
@ -31,7 +44,8 @@ jobs: |
|
|
|
with: |
|
|
|
context: . |
|
|
|
platforms: linux/amd64,linux/arm64 |
|
|
|
push: true |
|
|
|
tags: grobut939/ghostfolio:latest |
|
|
|
push: ${{ github.event_name != 'pull_request' }} |
|
|
|
tags: ${{ steps.meta.outputs.tags }} |
|
|
|
labels: ${{ steps.meta.output.labels }} |
|
|
|
cache-from: type=gha |
|
|
|
cache-to: type=gha,mode=max |
|
|
|