-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add Makefile for Exctract and add release workflow (#19)
* chore(ci): add Makefile for Extract and add release workflow * chore: add default make target * ci(release): format tags to x.y.z-c2c.a
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: GHCR Release CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+-c2c.[0-9]+" | ||
|
||
jobs: | ||
tests: | ||
name: Release new Docker Image in GHCR | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set current directory to Extract | ||
run: cd extract | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.repository_owner}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Build Docker images for GHCR | ||
run: make build_ghcr | ||
|
||
- name: Push Docker images to GHCR | ||
run: make push_ghcr |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
VERSION ?= $(shell git describe --always --tags) | ||
DOCKER_TAG ?= latest | ||
|
||
export DOCKER_BUILDKIT=1 | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: build_docker | ||
build_docker: ## Build docker image | ||
docker build --tag=camptocamp/asit-extract:$(VERSION) \ | ||
--build-arg=VERSION=$(VERSION) . | ||
docker tag camptocamp/asit-extract:$(VERSION) camptocamp/asit-extract:$(DOCKER_TAG) | ||
|
||
.PHONY: build_ghcr | ||
build_ghcr: ## Build docker image tagged for GHCR | ||
docker build --tag=ghcr.io/camptocamp/asit-extract:$(VERSION) \ | ||
--build-arg=VERSION=$(VERSION) . | ||
docker tag ghcr.io/camptocamp/asit-extract:$(VERSION) ghcr.io/camptocamp/asit-extract:$(DOCKER_TAG) | ||
|
||
.PHONY: push_ghcr | ||
push_ghcr: ## Push docker image to GHCR | ||
docker push ghcr.io/camptocamp/asit-extract:$(VERSION) | ||
docker push ghcr.io/camptocamp/asit-extract:$(DOCKER_TAG) | ||
|
||
.PHONY: help | ||
help: ## Display this help | ||
@echo "Usage: make <target>" | ||
@echo | ||
@echo "Available targets:" | ||
@grep --extended-regexp --no-filename '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | sort | \ | ||
awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s%s\n", $$1, $$2}' |