File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,23 @@ on: [push]
44
55jobs :
66 build-and-deploy :
7+ name : " Build Docker Image and deploy to Registry"
78 runs-on : ubuntu-latest
9+ if : github.ref == 'refs/heads/main'
810 steps :
911 - uses : actions/checkout@v2
10- - name : Build Docker Image
12+ - name : Set up QEMU
13+ uses : docker/setup-qemu-action@v2
14+ with :
15+ platforms : ' arm64,arm'
16+ - name : Setup Buildx
17+ uses : docker/setup-buildx-action@v2
18+ - name : Login to DockerRegistry
19+ uses : docker/login-action@v2
20+ with :
21+ registry : ghcr.io
22+ username : ${{ github.actor }}
23+ password : ${{ secrets.GITHUB_TOKEN }}
24+ - name : Build and push
1125 run : |
12- docker build -t docker.pkg.github.com/yanni8/m295/app:latest .
13- - name : Login to GitHub Packages
14- run : |
15- echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u "${{ github.actor }}" --password-stdin
16- - name : Push Docker Image
17- run : |
18- docker push docker.pkg.github.com/yanni8/m295/app:latest
26+ docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/yanni8/m295/app:latest --push .
You can’t perform that action at this time.
0 commit comments