Skip to content

Commit

Permalink
Add a CI job to build the container images
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-noaa committed Dec 20, 2023
1 parent 606e8f7 commit 7330417
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: "CI"
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
branches: [main]
pull_request:
workflow_dispatch: # Manually
env:
REGISTRY: ghcr.io/noaa-gsl/vxingest

jobs:
build-ingest:
name: Build Ingest image
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Generate image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/noaa-gsl/vxingest/ingest
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.vendor=NOAA's Global Systems Laboratory
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push
uses: docker/build-push-action@v5
with:
file: docker/ingest/Dockerfile
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
build-import:
name: Build Import image
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Generate image metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/noaa-gsl/vxingest/import
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.vendor=NOAA's Global Systems Laboratory
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push
uses: docker/build-push-action@v5
with:
file: docker/import/Dockerfile
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true

0 comments on commit 7330417

Please sign in to comment.