Some checks failed
Build and push Docker images / build-and-push (push) Failing after 1m40s
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Build and push Docker images
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 1440
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
attestations: write
|
|
id-token: write
|
|
|
|
env:
|
|
REGISTRY: docker.io
|
|
IMAGE_NAME: niccolon/raptor-deps:mlir0c2701f
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git clone --depth 1 --branch ${GITHUB_REF_NAME} \
|
|
https://chef.heaplab.deib.polimi.it/git/${GITHUB_REPOSITORY}.git \
|
|
${GITHUB_WORKSPACE}
|
|
|
|
- name: Install buildah
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y buildah
|
|
|
|
- name: Build image
|
|
run: |
|
|
cd ${GITHUB_WORKSPACE}/mlir0c2701f
|
|
buildah bud -t ${REGISTRY}/${IMAGE_NAME} -f Dockerfile .
|
|
|
|
- name: Push image
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
buildah login -u niccolon -p ${{ secrets.DOCKERHUB_TOKEN }} ${REGISTRY}
|
|
buildah push ${REGISTRY}/${IMAGE_NAME}
|