Some checks failed
Docker Build / build-and-push-image (push) Failing after 1m11s
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
---
|
|
# template source: https://github.com/bretfisher/docker-build-workflow/blob/main/templates/call-docker-build.yaml
|
|
name: Docker Build
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'chart/**'
|
|
# cancel any previously-started, yet still active runs of this workflow on the same branch
|
|
concurrency:
|
|
group: ${{ github.ref }}-${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-push-image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Login to Gitea Container Registry
|
|
run: |
|
|
mkdir -p ~/.docker
|
|
cat <<EOF > /root/.docker/config.json
|
|
{
|
|
"auths": {
|
|
"gitea.arcodange.duckdns.org": {
|
|
"auth": "$(echo ${{ github.actor }}:${{ secrets.PACKAGES_TOKEN }} | base64)"
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
chmod 644 /root/.docker/config.json
|
|
chmod 755 /root/.docker/
|
|
|
|
- name: git checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push image to Gitea Container Registry
|
|
run: |-
|
|
TAGS="latest ${{ github.ref_name }}"
|
|
docker build -t app .
|
|
for TAG in $TAGS; do
|
|
docker tag app gitea.arcodange.duckdns.org/${{ github.repository }}:$TAG
|
|
export HTTPS_PROXY=192.168.1.201:3128
|
|
docker push gitea.arcodange.duckdns.org/${{ github.repository }}:$TAG
|
|
unset HTTPS_PROXY
|
|
done
|
|
|