Skip to content

feat: rootfs - build/upload action and Dockerfile #4

feat: rootfs - build/upload action and Dockerfile

feat: rootfs - build/upload action and Dockerfile #4

Workflow file for this run

name: Build and Push Rootfs Docker Image
on:
push:
branches:
- main
#paths:
# - 'Dockerfile'
pull_request:
branches:
- main
#paths:
# - 'Dockerfile'
workflow_dispatch:
jobs:
build-rootfs-image:
strategy:
#fail-fast: true
matrix:
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.ROLE }}
role-session-name: rootfs-ecr-image-upload-session
aws-region: ${{ secrets.REGION }}
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
submodules: true
- name: Build, Tag, and Push Image
run: |

Check failure on line 37 in .github/workflows/rootfs.yaml

View workflow run for this annotation

GitHub Actions / Build and Push Rootfs Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/rootfs.yaml (Line: 37, Col: 14): Unexpected symbol: '}:"$HASH"'. Located at position 42 within expression: secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }:"$HASH" ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }:"$HASH" docker push ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME
# create sha256 of the Dockerfile to use as tag
HASH=$(sha256sum Dockerfile | cut -d ' ' -f 1)
# make empty tempdir for build context
BUILDCTX=$(mktemp -d)
DOCKER_BUILDKIT=1 docker build -f Dockerfile -t ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }}:"$HASH" "$BUILDCTX"
docker tag ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }:"$HASH" ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }:"$HASH"
docker push ${{ secrets.ROOTFS_IMAGE_ECR_REPOSITORY_NAME }}:"$HASH"