-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (32 loc) · 1.07 KB
/
release.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
name: Build and Push new release to ECR
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
role-session-name: github-actions-${{ github.repository_id }}-${{ github.ref_name }}
aws-region: us-east-1
- name: Login to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REGISTRY_ALIAS: ${{ secrets.ECR_ALIAS }}
REPOSITORY: ${{ secrets.ECR_REPO }}
IMAGE_TAG: ${{ github.ref_name }}
run: |
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG --build-arg NEXTCLOUD_TAG=$IMAGE_TAG-apache .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG