From ed9e47883febaa5c34c4439dab6e064b05cd796c Mon Sep 17 00:00:00 2001 From: = Date: Thu, 19 Dec 2024 11:39:26 +1300 Subject: [PATCH] feat: add gha for codebuild fedora arm --- .github/workflows/build-magpi.yml | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build-magpi.yml diff --git a/.github/workflows/build-magpi.yml b/.github/workflows/build-magpi.yml new file mode 100644 index 0000000..1daa58f --- /dev/null +++ b/.github/workflows/build-magpi.yml @@ -0,0 +1,59 @@ +name: magpibuild-arm64 +on: + push: + branches: + - main + - magpi_matt + 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-platformx + role-duration-seconds: 3600 + role-session-name: "github-actions-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: base-images + disable-source-override: true + env-vars-for-codebuild: | + GHCR_USER, + GHCR_TOKEN + buildspec-override: | + version: 0.2 + env: + shell: bash + git-credential-helper: yes + phases: + pre_build: + on-failure: ABORT + commands: + - git switch magpi_matt + - ls -lt + - cat README.md + build: + on-failure: ABORT + commands: + - git switch magpi_matt + - echo Build started on `date` + - docker build -t rpmbuild-fedora -f images/rpmbuild-fedora/Dockerfile . + - docker tag rpmbuild-fedora-arm:latest ghcr.io/geonet/base-images/rpmbuild-fedora:latest + post_build: + on-failure: ABORT + commands: + - docker login -u ${GHCR_USER} -p ${GHCR_TOKEN} ghcr.io +# - 'docker push ghcr.io/geonet/base-images/rpmbuild-fedora-arm:latest'