Skip to content

Commit

Permalink
ci: update build-image workflow (#258)
Browse files Browse the repository at this point in the history
* Update bug_report.md

* Update bug_report.md

* ci: update build-image workflow

* configure tags

* configure context

* configure dockerfile

* cleanup

* build for develop too
  • Loading branch information
andreiio authored Dec 4, 2023
1 parent 70036a2 commit 0aebff1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 49 deletions.
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ assignees: ''
### Description

<!--
A clear and concise description of what the bug is.
A clear and concise description of what the bug is. Please mention the platform (eg. "On the mobile app, ...")
-->

### Test environment

<!--
On which platform did you find this bug, Web or Mobile?
If Mobile, iOS or Android?
-->


Expand Down
67 changes: 19 additions & 48 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,30 @@ on:
push:
branches:
- main
- develop
tags:
- "v*"
- 'v*'
paths:
- "backend/**"
- 'backend/**'
workflow_dispatch:

name: Build Docker image

jobs:
build-docker-image:
name: Build Docker image
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::166485377238:role/github-actions-onghub-ecr
aws-region: eu-west-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ steps.login-ecr.outputs.registry }}/teo
tags: |
type=edge
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v3
with:
context: backend
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build:
name: Build Docker image
uses: code4romania/.github/.github/workflows/build-push-image-ecr.yml@main
with:
image_name: vic
region: eu-west-1
context: backend
dockerfile: backend/Dockerfile
tags: |
type=edge
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
secrets:
role_to_assume: ${{ secrets.ROLE_TO_ASSUME }}

0 comments on commit 0aebff1

Please sign in to comment.