fix: simplify workflow with basic commands for forgejo
Some checks failed
Build & Push Docker Image / build (push) Failing after 2s
Some checks failed
Build & Push Docker Image / build (push) Failing after 2s
This commit is contained in:
parent
e04fbeee13
commit
15982214a4
1 changed files with 18 additions and 19 deletions
|
|
@ -9,30 +9,29 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth 1 https://git.khoavo.myds.me/vndangkhoa/kv-tube.git /tmp/kv-tube
|
||||
cd /tmp/kv-tube
|
||||
git fetch --depth 0 origin main
|
||||
git checkout main
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Set up Docker
|
||||
run: |
|
||||
docker version
|
||||
docker info
|
||||
|
||||
- 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: Login to Forgejo Registry
|
||||
run: |
|
||||
echo "${{ secrets.FORGEJO_TOKEN }}" | docker login git.khoavo.myds.me -u ${{ secrets.FORGEJO_USERNAME }} --password-stdin
|
||||
|
||||
- name: Build and push
|
||||
env:
|
||||
IMAGE: git.khoavo.myds.me/vndangkhoa/kv-tube
|
||||
working-directory: /tmp/kv-tube
|
||||
run: |
|
||||
SHA_SHORT=$(git rev-parse --short HEAD)
|
||||
echo "Building commit: $SHA_SHORT"
|
||||
|
||||
# Build with platform for Synology NAS (linux/amd64)
|
||||
docker build --platform linux/amd64 -t ${IMAGE}:${SHA_SHORT} -t ${IMAGE}:latest .
|
||||
docker build --platform linux/amd64 -t git.khoavo.myds.me/vndangkhoa/kv-tube:${SHA_SHORT} -t git.khoavo.myds.me/vndangkhoa/kv-tube:latest .
|
||||
|
||||
# Push both tags
|
||||
docker push ${IMAGE}:${SHA_SHORT}
|
||||
docker push ${IMAGE}:latest
|
||||
docker push git.khoavo.myds.me/vndangkhoa/kv-tube:${SHA_SHORT}
|
||||
docker push git.khoavo.myds.me/vndangkhoa/kv-tube:latest
|
||||
Loading…
Reference in a new issue