Skip to content

Conda

Conda #34

Workflow file for this run

name: build_docker
on:
workflow_dispatch:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'
jobs:
build:
strategy:
matrix:
platform:
# - linux/arm64
- linux/amd64
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE: ghcr.io/climate-resource/wrf
WRF_VERSION: 4.5.1
WPS_VERSION: 4.5
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.IMAGE }}"
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=raw,value=${{ env.WRF_VERSION }},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: Build and push image
uses: docker/build-push-action@v5
id: build
with:
build-args: |
WRF_VERSION=${{ env.WRF_VERSION }}
WPS_VERSION=${{ env.WPS_VERSION }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max