docker-ipfs-keygen/.github/workflows/build.yaml

20 lines
856 B
YAML
Raw Normal View History

2024-03-02 17:07:02 +00:00
name: Github Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions (on Gitea) 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: metal-docker
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: |
REPO_BASE=${REPO_BASE_OVERRIDE-${GITHUB_SERVER_URL-https://github.com}}
docker build --progress plain --label "org.opencontainers.image.source=$REPO_BASE/$GITHUB_REPOSITORY" --iidfile iid.txt .
stringprefix() { [ ${#1} -le $2 ] && echo $1 && return 0 || stringprefix "${1%?}" $2 ; }
SHORTSHA="$(stringprefix "$GITHUB_SHA" 8)"
for TAG in "$SHORTSHA" "$GITHUB_REF_NAME";do
docker tag "`cat iid.txt`" "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG"
docker push "$DOCKER_REGISTRY/$GITHUB_REPOSITORY:$TAG"
done