forked from makersacademy/acebook-java-template
-
Notifications
You must be signed in to change notification settings - Fork 1
28 lines (22 loc) · 825 Bytes
/
cd.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: CD Pipeline
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build and push Docker image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
IMAGE_TAG: latest
run: |
docker buildx build --platform linux/amd64,linux/arm64 -t docker.io/${{ secrets.DOCKERHUB_USERNAME }}/acebook-red-panda:${IMAGE_TAG} --push .