Merge pull request #113 from uio-bmi/replace-java-jwt #60
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: Bump version and publish to ghcr.io | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
tag: | |
name: bump tags | |
outputs: | |
part: ${{ steps.bump_tag.outputs.part }} | |
tag: ${{ steps.bump_tag.outputs.tag }} | |
new_tag: ${{ steps.bump_tag.outputs.new_tag }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: '1' | |
- name: Bump version and push tag | |
id: bump_tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
push_to_registry: | |
needs: tag | |
if: needs.tag.outputs.part != '' | |
name: Push Docker image to Github Container registry | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Log in to the Github Container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
- name: create maven settings.xml | |
uses: s4u/[email protected] | |
with: | |
servers: | | |
[{ | |
"id":"github-clearinghouse", | |
"username": "${{ github.actor }}", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}, | |
{ | |
"id":"github-tsd-file-api-client", | |
"username": "${{ github.actor }}", | |
"password": "${{ secrets.GITHUB_TOKEN }}" | |
}] | |
- name: Copy settings.xml to project root | |
shell: bash | |
run: cp /home/runner/.m2/settings.xml ./settings.xml | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.tag }} | |
ghcr.io/${{ github.repository }}:latest | |
labels: | | |
org.opencontainers.image.source=${{ github.event.repository.clone_url }} | |
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') | |
org.opencontainers.image.revision=${{ github.sha }} |