Skip to content

Commit 2d75e4d

Browse files
committed
Add GitHub Actions workflow for Docker build and push
1 parent 35a3dd1 commit 2d75e4d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
tags:
5+
- '*'
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: install docker emulation
18+
run: docker run --rm --privileged tonistiigi/binfmt:latest --install amd64,arm64
19+
- name: Set up buildx
20+
uses: docker/setup-buildx-action@v3
21+
- name: Login to ghcr.io
22+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
23+
- name: Build and push
24+
run: |
25+
docker buildx build --platform linux/amd64,linux/arm64 -t $(echo 'ghcr.io/${{ github.repository }}:${{ github.ref_name }}' | tr '[:upper:]' '[:lower:]') --push .

0 commit comments

Comments
 (0)