Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github ci to publish container (testrun) #7

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Build and publish a 🛢️ container

on:
push:
branches:
- 'main'
tags:
- '*'
workflow_dispatch:

jobs:
build-and-push-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Source checkout
uses: actions/checkout@v4

- name: Get semantic-release version
id: get_version
run: echo "sr_version="$(jq -r '.dependencies."semantic-release"' package.json | sed 's/\^//') >> $GITHUB_OUTPUT

# Parse ref_name and if it is main, change it ot latest
- name: Set tag
id: set_tag
run: echo "tag=$(echo ${{ github.ref_name }} | sed 's/^main$/latest/')" >> $GITHUB_OUTPUT

- name: Build Vox Pupuli semantic-release container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_arch: linux/amd64,linux/arm64
docker_username: voxpupulibot
docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
tags: |
ghcr.io/voxpupuli/semantic-release:${{ steps.get_version.outputs.sr_version }}-${{ steps.set_tag.outputs.tag }}
ghcr.io/voxpupuli/semantic-release:latest
docker.io/voxpupuli/semantic-release:${{ steps.get_version.outputs.sr_version }}-${{ steps.set_tag.outputs.tag }}
docker.io/voxpupuli/semantic-release:latest

- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
repository: voxpupuli/semantic-release
Loading