42807890af
Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
56 lines
2.1 KiB
YAML
56 lines
2.1 KiB
YAML
name: Build and upload Data observatory container to harbor.nymte.ch
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
WORKING_DIRECTORY: "nym-data-observatory"
|
|
CONTAINER_NAME: "data-observatory"
|
|
|
|
jobs:
|
|
build-container:
|
|
runs-on: arc-linux-latest-dind
|
|
steps:
|
|
- name: Login to Harbor
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: harbor.nymte.ch
|
|
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
|
|
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Configure git identity
|
|
run: |
|
|
git config --global user.email "lawrence@nymtech.net"
|
|
git config --global user.name "Lawrence Stalder"
|
|
|
|
- name: Get version from cargo.toml
|
|
uses: mikefarah/yq@v4.52.4
|
|
id: get_version
|
|
with:
|
|
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
|
|
|
|
- name: Check if tag exists
|
|
run: |
|
|
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
|
|
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
|
|
fi
|
|
|
|
- name: Remove existing tag if exists
|
|
run: |
|
|
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
|
|
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
|
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
|
fi
|
|
|
|
- name: Create tag
|
|
run: |
|
|
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
|
|
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
|
|
|
|
- name: BuildAndPushImageOnHarbor
|
|
run: |
|
|
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
|
|
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
|