-
Notifications
You must be signed in to change notification settings - Fork 40
28 lines (26 loc) · 935 Bytes
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Docker Image CI
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v2.10.0
with:
platforms: linux/arm/v7,linux/arm64/v8
- name: Log in to the Container registry
uses: docker/login-action@v2.2.0
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Short SHA
id: shortsha
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build container
run: docker buildx build --push -t ghcr.io/${{github.repository}}:latest -t ghcr.io/${{github.repository}}:${{ github.sha }} -t ghcr.io/${{github.repository}}:${{ steps.shortsha.outputs.sha_short }} --platform linux/arm/v7,linux/arm64/v8 .