Skip to content

Commit 21965b3

Browse files
committed
Feature Docker image
1 parent c48ac46 commit 21965b3

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: MultiArchDockerFeature
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/*
7+
8+
jobs:
9+
docker:
10+
name: Build multi-arch Docker image.
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: tag number
14+
run : echo ${{ github.event.release.tag_name }}
15+
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
id: buildx
24+
uses: docker/setup-buildx-action@v3
25+
with:
26+
install: true
27+
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Login to GitHub Container Registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.repository_owner }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Set lower case owner name
42+
run: |
43+
echo "REG_REPO=${REPO,,}" >> ${GITHUB_ENV}
44+
env:
45+
REPO: '${{ github.repository }}'
46+
47+
- name: Check env
48+
run: |
49+
echo ${{ env.REG_REPO }}
50+
51+
- name: Build and push
52+
uses: docker/build-push-action@v5
53+
with:
54+
context: .
55+
platforms: linux/amd64,linux/arm64,linux/arm/v7
56+
push: true
57+
tags: |
58+
${{ secrets.DOCKERHUB_USERNAME }}/jacred:feature
59+
ghcr.io/${{ env.REG_REPO }}:feature
60+
cache-from: type=gha,scope=${{ github.workflow }}
61+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

0 commit comments

Comments
 (0)