Skip to content

Build and push docker image to latest #3

Build and push docker image to latest

Build and push docker image to latest #3

name: "Build and push docker image to latest"
on:
[workflow_dispatch]
jobs:
Build:
runs-on: ubuntu-latest
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 }}:latest-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 }}:latest-arm64
- name: Create image manifest with latest tag
run: |
docker manifest create ghcr.io/tibor309/code-tunnel:latest \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:latest-amd64 \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:latest-arm64
- name: Push image manifest
run: |
docker manifest push ghcr.io/tibor309/code-tunnel:latest