Skip to content

Commit

Permalink
Tag container image and push to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Falk-Petersen committed Sep 11, 2024
1 parent ac505d5 commit 16a1f8b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches:
- "**"
tags:
- "v*.*.*"

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag sedr:$(date +%s)
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
sedr
ghcr.io/metno/sedr
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the Docker image
uses: docker/build-push-action@v6
with:
run: docker build . --file Dockerfile --tag sedr:$(date +%s)
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion sedr.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from shapely.wkt import loads as wkt_loads
from urllib.parse import urlsplit

sedr_version = "0.7.0"
sedr_version = "v0.7.0"
edr_version = "1.1"

# Globals
Expand Down

0 comments on commit 16a1f8b

Please sign in to comment.