Build and upload Nyxd rpcnode container to harbor.nymte.ch #3
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: Build and upload Nyxd rpcnode container to harbor.nymte.ch | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: Which version of nyxd-rpcnode is this? | |
env: | |
WORKING_DIRECTORY: "docker/rpcnode" | |
CONTAINER_NAME: "nyxd-rpcnode" | |
jobs: | |
build-container: | |
runs-on: arc-ubuntu-22.04-dind | |
steps: | |
- name: Login to Harbor | |
uses: docker/login-action@v3 | |
with: | |
registry: harbor.nymte.ch | |
username: ${{ secrets.HARBOR_ROBOT_USERNAME }} | |
password: ${{ secrets.HARBOR_ROBOT_SECRET }} | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Configure git identity | |
run: | | |
git config --global user.email "lawrence@nymtech.net" | |
git config --global user.name "Lawrence Stalder" | |
- name: Remove existing tag if exists | |
run: | | |
if git rev-parse ${{ env.CONTAINER_NAME }}-${{ github.event.inputs.version }} >/dev/null 2>&1; then | |
git push --delete origin ${{ env.CONTAINER_NAME }}-${{ github.event.inputs.version }} | |
git tag -d ${{ env.CONTAINER_NAME }}-${{ github.event.inputs.version }} | |
fi | |
- name: Create tag | |
run: | | |
git tag -a ${{ env.CONTAINER_NAME }}-${{ github.event.inputs.version }} -m "Version ${{ github.event.inputs.version }}" | |
git push origin ${{ env.CONTAINER_NAME }}-${{ github.event.inputs.version }} | |
- name: BuildAndPushImageOnHarbor | |
run: | | |
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile ${{ env.WORKING_DIRECTORY }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ github.event.inputs.version }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest | |
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags |