Skip to content

Build Docker image - workflow_dispatch #6

Build Docker image - workflow_dispatch

Build Docker image - workflow_dispatch #6

name: Manual rebuild
on:
[workflow_dispatch]
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
PKG_VER: ${{ steps.getver.outputs.PKG_VER }}
steps:
- name: Download latest build
run: |
curl -vSLo zen.linux-generic.tar.bz2 https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-x86_64.tar.bz2
- name: Extract package
run: |
tar -xvf zen.linux-generic.tar.bz2
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libasound2 \
libgtk-3-0 \
libx11-xcb1
- name: Get package version
id: getver
run: |
PKG_VER=$(./zen/zen --version | awk '{print $3}')
echo "PKG_VER=${PKG_VER}" >> $GITHUB_OUTPUT
echo "The package version is $PKG_VER"
rebuild:
runs-on: ubuntu-latest
needs: get-version
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: tibor309
password: ${{ secrets.GH_TOKEN }}
- name: Build image for amd64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: ./Dockerfile
push: true
provenance: false
tags: ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64
- name: Build image for arm64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
file: ./Dockerfile.aarch64
push: true
provenance: false
tags: ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Create image manifest with version tag
run: |
docker manifest create ghcr.io/tibor309/zen:${{ needs.get-version.outputs.PKG_VER }} \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64 \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Create image manifest with latest tag
run: |
docker manifest create ghcr.io/tibor309/zen:latest \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64 \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Push image manifests
run: |
docker manifest push ghcr.io/tibor309/zen:latest
docker manifest push ghcr.io/tibor309/zen:${{ needs.get-version.outputs.PKG_VER }}