Build quasselcore image #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build quasselcore image" | |
env: | |
IMAGE_NAME: "quasselcore" | |
REGISTRY: "quay.io/travier" | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- quasselcore/* | |
- .github/workflows/quasselcore.yml | |
push: | |
branches: | |
- main | |
paths: | |
- quasselcore/* | |
- .github/workflows/quasselcore.yml | |
schedule: | |
- cron: '0 0 * * MON' | |
permissions: read-all | |
# Prevent multiple workflow runs from racing to ensure that pushes are made | |
# sequentialy for the main branch. Also cancel in progress workflow runs for | |
# pull requests only. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
jobs: | |
build-push-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Build container image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
context: ${{ env.IMAGE_NAME }} | |
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: latest ${{ github.sha }} | |
containerfiles: ${{ env.IMAGE_NAME }}/Containerfile | |
layers: false | |
oci: true | |
- name: Push to Quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' | |
with: | |
username: ${{ secrets.BOT_USERNAME }} | |
password: ${{ secrets.BOT_SECRET }} | |
image: ${{ env.IMAGE_NAME }} | |
registry: ${{ env.REGISTRY }} | |
tags: latest ${{ github.sha }} |