Skip to content

Tweaked the repo config for CI #3

Tweaked the repo config for CI

Tweaked the repo config for CI #3

Workflow file for this run

name: Build and upload docker image
permissions:
id-token: write # for JWT request
contents: read # for actions/checkout
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
branches:
- '**'
jobs:
docker-image-build:
name: docker-image-build
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
with:
limit-access-to-actor: true
- uses: actions/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ vars.AWS_ROLE_TO_ASSUME }}
aws-region: eu-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/[email protected]
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: fb-editor
IMAGE_TAG: ${{ github.sha }}
run: |
docker -f docker/web/Dockerfile build -t ${REGISTRY}/${REPOSITORY}:${IMAGE_TAG} .
docker tag ${REPOSITORY}:${IMAGE_TAG} ${REGISTRY}/${REPOISTORY}:${IMAGE_TAG}
docker push ${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}