51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
on:
|
|
push:
|
|
branches: [ master, main ]
|
|
pull_request:
|
|
branches: [ master, main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: all
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: false
|
|
tags: kv-download:latest
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
- name: Login to Docker Registry
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.khoavo.myds.me
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Docker image
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.khoavo.myds.me/vndangkhoa/kv-download:latest
|
|
git.khoavo.myds.me/vndangkhoa/kv-download:{{ sha }}
|
|
platforms: linux/amd64,linux/arm64
|