testiä
CI Feature / Load gitea-env.conf to pipeline env (push) Successful in 12s
ci-validate CI validation FAILED
CI Feature / Validate CI config (push) Failing after 17s
ci-bats Bats tests OK
CI Feature / Bats tests (push) Successful in 1m38s
ci-cucumber Running Cucumber tests...
CI Feature / Cucumber tests (push) Failing after 1m14s
CI Feature / Report Index (push) Has been skipped
CI Feature / Load gitea-env.conf to pipeline env (push) Successful in 12s
ci-validate CI validation FAILED
CI Feature / Validate CI config (push) Failing after 17s
ci-bats Bats tests OK
CI Feature / Bats tests (push) Successful in 1m38s
ci-cucumber Running Cucumber tests...
CI Feature / Cucumber tests (push) Failing after 1m14s
CI Feature / Report Index (push) Has been skipped
This commit is contained in:
@@ -29,7 +29,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -40,10 +40,13 @@ jobs:
|
||||
|
||||
- name: Set Gitea status to PENDING
|
||||
run: |
|
||||
echo "===== gitea-ci-library - Docker Build | begin ====="
|
||||
bash .ci/scripts/report-status.sh pending "Building Docker image..." ci-docker-build
|
||||
echo "===== gitea-ci-library - Docker Build & Push | begin ====="
|
||||
bash .ci/scripts/report-status.sh pending "Building and pushing Docker image..." ci-docker-build-push
|
||||
|
||||
- name: Build container
|
||||
- name: Build and push container
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME || github.actor }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
docker build \
|
||||
@@ -52,56 +55,6 @@ jobs:
|
||||
--label "build.date=${NOW}" \
|
||||
-t "${DOCKER_IMAGE_NAME}:${VERSION}" .
|
||||
|
||||
- name: Report status SUCCESS
|
||||
if: success()
|
||||
run: bash .ci/scripts/report-status.sh success "Docker build ${VERSION} OK" ci-docker-build
|
||||
|
||||
- name: Report status FAILURE
|
||||
if: failure()
|
||||
run: bash .ci/scripts/report-status.sh failure "Docker build ${VERSION} FAILED" ci-docker-build
|
||||
|
||||
- name: Save Docker image
|
||||
if: success()
|
||||
run: |
|
||||
mkdir -p /tmp/image
|
||||
docker save "${DOCKER_IMAGE_NAME}:${VERSION}" -o /tmp/image/artifact.tar
|
||||
|
||||
- name: Upload Docker image artifact
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: docker-image
|
||||
path: /tmp/image/artifact.tar
|
||||
retention-days: 1
|
||||
|
||||
push:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: niko/gitea-ci-library
|
||||
path: .ci
|
||||
|
||||
- name: Load saved Docker image
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: docker-image
|
||||
path: /tmp/image
|
||||
|
||||
- name: Set Gitea status to PENDING
|
||||
run: |
|
||||
echo "===== gitea-ci-library - Docker Push | begin ====="
|
||||
bash .ci/scripts/report-status.sh pending "Pushing to registry..." ci-docker-push
|
||||
|
||||
- name: Push to Docker Registry
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME || github.actor }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
docker load -i /tmp/image/artifact.tar
|
||||
|
||||
REGISTRY="${DOCKER_REGISTRY:?DOCKER_REGISTRY not set in env.conf}"
|
||||
IMAGE="${DOCKER_IMAGE_NAME:?DOCKER_IMAGE_NAME not set in env.conf}"
|
||||
REGISTRY_HOST="${REGISTRY%%/*}"
|
||||
@@ -121,15 +74,15 @@ jobs:
|
||||
if [ -n "${DOCKER_UI_URL:-}" ] && [ -n "${VERSION:-}" ]; then
|
||||
CONTAINER_URL="${DOCKER_UI_URL}/${VERSION}"
|
||||
fi
|
||||
bash .ci/scripts/report-status.sh success "Docker push ${VERSION} OK" ci-docker-push "" "$CONTAINER_URL"
|
||||
bash .ci/scripts/report-status.sh success "Docker build & push ${VERSION} OK" ci-docker-build-push "" "$CONTAINER_URL"
|
||||
|
||||
- name: Report status FAILURE
|
||||
if: failure()
|
||||
run: bash .ci/scripts/report-status.sh failure "Docker push ${VERSION} FAILED" ci-docker-push
|
||||
run: bash .ci/scripts/report-status.sh failure "Docker build & push ${VERSION} FAILED" ci-docker-build-push
|
||||
|
||||
tag-commit:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [push]
|
||||
needs: [build-push]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user