Skip to content

Bump version to 1.0.3 #39

Bump version to 1.0.3

Bump version to 1.0.3 #39

name: Build and Publish Docker Images
on:
push:
branches:
- main
- master
tags:
- 'v*'
pull_request:
branches:
- main
- master
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }}/dcrpulse
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
component:
- name: dcrd
context: ./dcrd
platforms: linux/amd64,linux/arm64
- name: dcrwallet
context: ./dcrwallet
platforms: linux/amd64,linux/arm64
- name: dashboard
context: ./dashboard
platforms: linux/amd64,linux/arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_PREFIX }}-${{ matrix.component.name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=2.1.3,enable=${{ matrix.component.name == 'dcrd' && github.ref_type == 'tag' }}
type=raw,value=2.1,enable=${{ matrix.component.name == 'dcrd' && github.ref_type == 'tag' }}
type=raw,value=2.1.3,enable=${{ matrix.component.name == 'dcrwallet' && github.ref_type == 'tag' }}
type=raw,value=2.1,enable=${{ matrix.component.name == 'dcrwallet' && github.ref_type == 'tag' }}
type=semver,pattern={{version}},enable=${{ matrix.component.name == 'dashboard' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ matrix.component.name == 'dashboard' }}
type=semver,pattern={{major}},enable=${{ matrix.component.name == 'dashboard' }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.component.context }}
platforms: ${{ matrix.component.platforms }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
${{ matrix.component.name == 'dcrd' && 'DCRD_VERSION=release-v2.1.3' || '' }}
${{ matrix.component.name == 'dcrwallet' && 'DCRWALLET_VERSION=release-v2.1.3' || '' }}