mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-03-26 03:03:25 +01:00
All checks were successful
Build and Push to Harbor when new commit to main-branch / build (push) Successful in 16m18s
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: Build and Push to Harbor when new commit to main-branch
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: linux_amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Free disk before build
|
|
run: |
|
|
podman system prune -af --volumes || true
|
|
df -h
|
|
|
|
- name: Login to Harbor (Robot)
|
|
if: ${{ secrets.HARBOR_REGISTRY && secrets.HARBOR_USERNAME && secrets.HARBOR_PASSWORD }}
|
|
env:
|
|
REGISTRY: ${{ secrets.HARBOR_REGISTRY }}
|
|
ROBOT_USER: ${{ secrets.HARBOR_USERNAME }}
|
|
ROBOT_PASS: ${{ secrets.HARBOR_PASSWORD }}
|
|
run: |
|
|
mkdir -p "$HOME/.config/containers"
|
|
echo "$ROBOT_PASS" | podman login --username "$ROBOT_USER" --password-stdin "$REGISTRY"
|
|
|
|
|
|
- name: Build & tag
|
|
timeout-minutes: 60
|
|
env:
|
|
REG: ${{ secrets.HARBOR_REGISTRY }}
|
|
PROJ: ${{ secrets.HARBOR_PROJECT }}
|
|
run: |
|
|
podman build -t $REG/$PROJ/swiss-datashare:${{ github.sha }} .
|
|
podman tag $REG/$PROJ/swiss-datashare:${{ github.sha }} $REG/$PROJ/swiss-datashare:latest
|
|
|
|
- name: Push
|
|
env:
|
|
REG: ${{ secrets.HARBOR_REGISTRY }}
|
|
PROJ: ${{ secrets.HARBOR_PROJECT }}
|
|
run: |
|
|
podman push $REG/$PROJ/swiss-datashare:${{ github.sha }}
|
|
podman push $REG/$PROJ/swiss-datashare:latest
|