-
Notifications
You must be signed in to change notification settings - Fork 68
42 lines (40 loc) · 1.43 KB
/
build.yaml
File metadata and controls
42 lines (40 loc) · 1.43 KB
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
name: Build images
on:
workflow_dispatch:
release:
types: [published]
env:
AWS_REGION: eu-west-1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_PASSWORD }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push CE images to Amazon ECR
env:
BUILD_HASH: ${{ github.sha }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: mergin/mergin-ce
run: |
IMAGE_TAG="build-$GITHUB_SHA"
echo "IMAGE_TAG=$IMAGE_TAG" >> "$GITHUB_ENV"
cd server
docker build -f Dockerfile . --build-arg BUILD_HASH=${BUILD_HASH} -t $ECR_REGISTRY/$REPOSITORY-back:$IMAGE_TAG;
cd ../web-app
docker build -f Dockerfile . -t $ECR_REGISTRY/$REPOSITORY-front:$IMAGE_TAG
docker push $ECR_REGISTRY/$REPOSITORY-back:$IMAGE_TAG
docker push $ECR_REGISTRY/$REPOSITORY-front:$IMAGE_TAG
- name: Build info
run: |
echo "IMAGE_TAG=$IMAGE_TAG"
echo "GITHUB_SHA=$GITHUB_SHA"
echo "TARGET_BRANCH=${{ github.ref_name }}"