forked from Sunagatov/Iced-Latte
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.14 KB
/
build.yaml
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
name: Build and Deploy
on:
push:
branches:
- development
jobs:
build-and-push-docker-image:
name: Build and push a new docker image
runs-on: ubuntu-latest
steps:
- name: Checkout the source code from the Github repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
timeout-minutes: 5
- name: Create Tag
id: tag
run: echo "tag=backend-${{ github.ref_name }}-$(git rev-parse --short HEAD)-$(date +%s)" >> $GITHUB_OUTPUT
timeout-minutes: 5
- name: Login to ECR
uses: docker/login-action@v3
with:
registry: ${{ secrets.AWS_ECR_REGISTRY }}
username: ${{ secrets.AWS_ECR_ACCESS_KEY_ID}}
password: ${{ secrets.AWS_ECR_SECRET_ACCESS_KEY }}
timeout-minutes: 5
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.local
push: true
tags: ${{ secrets.AWS_ECR_REGISTRY }}/${{ vars.AWS_ECR_REPOSITORY_APP }}:${{ steps.tag.outputs.tag }}
timeout-minutes: 5