ci: add Forgejo workflow for Docker build and push
Some checks failed
Build & Push Docker Image / build (push) Failing after 4s
Some checks failed
Build & Push Docker Image / build (push) Failing after 4s
This commit is contained in:
parent
f210acc05c
commit
19fb885f81
1 changed files with 21 additions and 9 deletions
|
|
@ -10,17 +10,29 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
cd /tmp
|
with:
|
||||||
rm -rf kv-tube
|
fetch-depth: 0
|
||||||
git clone https://vndangkhoa:b14bc4938aeb5f4014fa15186985a0a625f7e9b4@nas:3050/vndangkhoa/kv-tube.git
|
|
||||||
cd kv-tube
|
- name: Set up Docker Buildx
|
||||||
git checkout ${GITEA_SHA:-main}
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Forgejo Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.khoavo.myds.me
|
||||||
|
username: ${{ secrets.FORGEJO_USERNAME }}
|
||||||
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
|
env:
|
||||||
|
IMAGE: git.khoavo.myds.me/vndangkhoa/kv-tube
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/kv-tube
|
|
||||||
SHA_SHORT=$(git rev-parse --short HEAD)
|
SHA_SHORT=$(git rev-parse --short HEAD)
|
||||||
IMAGE="git.khoavo.myds.me/vndangkhoa/kv-tube"
|
|
||||||
docker build -t ${IMAGE}:${SHA_SHORT} .
|
# Build with platform for Synology NAS (linux/amd64)
|
||||||
|
docker build --platform linux/amd64 -t ${IMAGE}:${SHA_SHORT} -t ${IMAGE}:latest .
|
||||||
|
|
||||||
|
# Push both tags
|
||||||
docker push ${IMAGE}:${SHA_SHORT}
|
docker push ${IMAGE}:${SHA_SHORT}
|
||||||
|
docker push ${IMAGE}:latest
|
||||||
Loading…
Reference in a new issue