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
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
cd /tmp
|
||||
rm -rf kv-tube
|
||||
git clone https://vndangkhoa:b14bc4938aeb5f4014fa15186985a0a625f7e9b4@nas:3050/vndangkhoa/kv-tube.git
|
||||
cd kv-tube
|
||||
git checkout ${GITEA_SHA:-main}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
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
|
||||
env:
|
||||
IMAGE: git.khoavo.myds.me/vndangkhoa/kv-tube
|
||||
run: |
|
||||
cd /tmp/kv-tube
|
||||
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}:latest
|
||||
Loading…
Reference in a new issue