Don't bother caching #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build ECS Toolchain Image | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::068738303278:role/GithubECSRepoPolicy | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Determine Docker Tags | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
068738303278.dkr.ecr.us-east-1.amazonaws.com/elastic-common-schema-toolchain | |
flavor: | | |
# Manually add latest tag in tags: | |
latest=false | |
tags: | | |
# Tag with pr number when in pr | |
type=ref,event=pr | |
# set latest tag for default branch when built on default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
# Tag with short sha when built on default branch | |
type=sha,enable={{is_default_branch}} | |
# Setting up Docker Buildx with docker-container driver is required | |
# at the moment to be able to use a subdirectory with Git context | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true |