Wave/.github/workflows/docker.yml

71 lines
2 KiB
YAML
Raw Normal View History

2024-03-27 09:00:20 +00:00
name: Docker Release
2024-02-19 19:31:53 +00:00
on:
push:
tags: [ v* ]
2024-02-19 19:31:53 +00:00
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image_suffix: ["", "-alpine"]
2024-02-19 19:31:53 +00:00
permissions:
contents: read
packages: write
attestations: write
id-token: write
2024-02-19 19:31:53 +00:00
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract metadata for the image
id: meta
uses: docker/metadata-action@v5
with:
images: |
miawinter/wave
ghcr.io/${{ github.repository }}
2024-02-19 20:00:45 +00:00
tags: |
type=semver,pattern={{version}}
flavor: |
2024-02-25 22:27:14 +00:00
latest=true
2024-06-18 09:50:47 +00:00
suffix=${{ matrix.image_suffix }},onlatest=true
2024-02-20 10:35:20 +00:00
labels: |
maintainer=Mia Rose Winter
org.opencontainers.image.title=Wave
org.opencontainers.image.url=https://github.com/miawinter98/wave
org.opencontainers.image.source=https://github.com/miawinter98/wave
org.opencontainers.image.description=The Collaborative Open Source Blogging Engine
org.opencontainers.image.vendor=Winter Software
org.opencontainers.image.licenses=MIT
2024-02-19 19:31:53 +00:00
- name: Log into the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into Docker Hub
2024-02-19 19:31:53 +00:00
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2024-02-19 19:42:16 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2024-02-19 19:31:53 +00:00
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
2024-02-19 19:39:50 +00:00
file: Wave/Dockerfile
2024-02-19 19:31:53 +00:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2024-02-20 10:35:20 +00:00
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
2024-06-18 09:50:47 +00:00
BASE=${{ matrix.image_suffix }}