name: Build Container on: workflow_dispatch: push: push: tags: - "v*" schedule: # daily builds to always include patches in the docker image - cron: '0 4 * * *' env: CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Cache Docker layers uses: actions/cache@v2 with: path: /var/lib/containers/ key: ${{ runner.os }}-podman-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ runner.os }}-podman- - name: Build id: build-image uses: redhat-actions/buildah-build@v2 with: context: . layers: true containerfiles: ./Containerfile platforms: ${{github.event.inputs.platforms}} image: trivernis/tobi - name: Login to DockerHub uses: redhat-actions/podman-login@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} registry: docker.io - name: Push uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image.outputs.image }} tags: ${{ steps.build-image.outputs.tags }} registry: docker.io