From 6e5f152dd8e2050cc71ecb1f8a4c01c6b97146da Mon Sep 17 00:00:00 2001 From: nroulon Date: Fri, 3 May 2024 14:19:16 +0200 Subject: [PATCH] feat: add a job for build a docker image for linux/amd64 and linux/arm64 --- .dockerignore | 1 + .../workflows/publish_docker_packages.yaml | 35 +++++++++++++++++++ release.sh | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish_docker_packages.yaml diff --git a/.dockerignore b/.dockerignore index 466fcba..7e525d3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,3 +12,4 @@ install-aki.py sample tests tox.ini +.github diff --git a/.github/workflows/publish_docker_packages.yaml b/.github/workflows/publish_docker_packages.yaml new file mode 100644 index 0000000..5e0a0df --- /dev/null +++ b/.github/workflows/publish_docker_packages.yaml @@ -0,0 +1,35 @@ +name: Publish docker packages on GitHub + +on: + push: + tags: + - '*' + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/4sh/aki:latest + ghcr.io/4sh/aki:${{ github.ref_name }} diff --git a/release.sh b/release.sh index fd3334f..10018d3 100755 --- a/release.sh +++ b/release.sh @@ -18,4 +18,4 @@ git commit --all --message "release $version" git tag "v$version" echo "upload $script_directory/dist/aki-$version.tar.gz to a new release $version on https://github.com/4sh/aki/releases" -echo "push for publish docker package" +echo "push for publish version and docker package : git push && git push --tags"