new pvlive url (#139) #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Containers | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- 'README.md' | |
jobs: | |
build-container: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
if: github.event_name != 'pull_request' | |
strategy: | |
matrix: | |
include: | |
- folder: containers/icon | |
image: ghcr.io/openclimatefix/icon-etl | |
- folder: containers/sat | |
image: ghcr.io/openclimatefix/sat-etl | |
- folder: containers/gfs | |
image: ghcr.io/openclimatefix/gfs-etl | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Container | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ matrix.image }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.folder }} | |
file: ${{ matrix.folder }}/Containerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=${{ matrix.image }}:buildcache | |
cache-to: type=registry,ref=${{ matrix.image }}:buildcache,mode=max | |