Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit faca3f4

Browse files
authored
Merge pull request #13 from uio-bmi/feature/version_pump
Add version pump #major
2 parents 8aabf62 + 7379d7f commit faca3f4

File tree

2 files changed

+66
-45
lines changed

2 files changed

+66
-45
lines changed

.github/workflows/ghcr-publish.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Bump version and publish to ghcr.io
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
tag:
9+
name: bump tags
10+
outputs:
11+
part: ${{ steps.bump_tag.outputs.part }}
12+
tag: ${{ steps.bump_tag.outputs.tag }}
13+
new_tag: ${{ steps.bump_tag.outputs.new_tag }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: '1'
19+
- name: Bump version and push tag
20+
id: bump_tag
21+
uses: anothrNick/github-tag-action@1.36.0
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
WITH_V: true
25+
DEFAULT_BUMP: patch
26+
27+
push_to_registry:
28+
needs: tag
29+
if: needs.tag.outputs.part != ''
30+
name: Push Docker image to Github Container registry
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
packages: write
35+
steps:
36+
- name: Check out the repo
37+
uses: actions/checkout@v2
38+
39+
- name: Log in to the Github Container registry
40+
uses: docker/login-action@v1
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Extract metadata (tags, labels) for Docker
47+
id: meta
48+
uses: docker/metadata-action@v3
49+
with:
50+
images: ghcr.io/${{ github.repository }}
51+
52+
- name: Build and push
53+
uses: docker/build-push-action@v2
54+
with:
55+
context: .
56+
file: ./Dockerfile
57+
push: true
58+
tags: |
59+
ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.tag }}
60+
ghcr.io/${{ github.repository }}:latest
61+
${{ github.repository }}:${{ needs.tag.outputs.tag }}
62+
${{ github.repository }}:latest
63+
labels: |
64+
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
65+
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
66+
org.opencontainers.image.revision=${{ github.sha }}

0 commit comments

Comments
 (0)