-
-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (40 loc) · 1.44 KB
/
docker-preview.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Publish Preview Docker image
on:
push:
branches:
- dev
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
run: npm install
working-directory: frontend
- name: Build frontend
run: npm run build
working-directory: frontend
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create builder instance
run: docker buildx create --name perplexedBuilder --use
- name: Build and push the amd64 image
run: docker buildx build --platform linux/amd64 -t ipmake/perplexed:preview-amd64 . --push
- name: Build and push the arm64 image
run: docker buildx build --platform linux/arm64 -t ipmake/perplexed:preview-arm64 . --push
- name: Build and push multi-platform Docker image
run: docker buildx imagetools create --tag ipmake/perplexed:preview ipmake/perplexed:preview-amd64 ipmake/perplexed:preview-arm64