Skip to content

Commit

Permalink
feat: add gha for codebuild fedora arm
Browse files Browse the repository at this point in the history
Add github actions workflow for running arm fedora codebuild builds.
  • Loading branch information
MCorfy authored and Mossman1215 committed Dec 19, 2024
1 parent ce80af4 commit 5d4a5e2
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/build-magpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: magpibuild-arm64
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}
permissions:
id-token: write
packages: write
concurrency:
group: ${{ github.run_id }}
cancel-in-progress: true
jobs:
codebuild:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
aws-region: ap-southeast-2
role-to-assume: arn:aws:iam::615890063537:role/tf-dev-github-actions-geonet-codebuild-magpi
role-duration-seconds: 3600
role-session-name: "github-actions-base-images-arm64-magpi"
- name: Run CodeBuild
uses: aws-actions/aws-codebuild-run-build@v1
env:
GHCR_USER: ${{ github.actor }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
project-name: tf-dev-magpi-codebuild
disable-source-override: false
source-version-override: ${{ github.ref }}
env-vars-for-codebuild: |
GHCR_USER,
GHCR_TOKEN
buildspec-override: |
version: 0.2
env:
shell: bash
git-credential-helper: yes
phases:
build:
on-failure: ABORT
commands:
- docker build -t rpmbuild-fedora images/rpmbuild-fedora
- docker tag rpmbuild-fedora:latest ghcr.io/geonet/base-images/rpmbuild-fedora:latest
post_build:
on-failure: ABORT
commands:
- |
if expr "${CODEBUILD_SOURCE_VERSION}" : "refs/heads/main" >/dev/null; then
docker login -u ${GHCR_USER} -p ${GHCR_TOKEN} ghcr.io
docker push ghcr.io/geonet/base-images/rpmbuild-fedora:latest
fi
2 changes: 1 addition & 1 deletion images/rpmbuild-fedora/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/geonet/base-images/fedora:40
FROM ghcr.io/geonet/base-images/fedora:41-aarch64
# Installing tools needed for rpmbuild
RUN dnf update -y && \
dnf install -y \
Expand Down

0 comments on commit 5d4a5e2

Please sign in to comment.