Merge pull request #795 from jelmer/dd4adependabot/pip/ruff-0.6.5 #2079
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 and Publish Differ Container Image | |
"on": | |
# run it on push to the default repository branch | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: '0 6 * * *' # Daily 6AM UTC build | |
jobs: | |
# define job to build and publish container image | |
build-and-push-differ-container-image: | |
name: Build container image and push to repositories | |
# run only when code is compiling and tests are passing | |
runs-on: ubuntu-latest | |
# steps to perform in job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Determine tags to set (pull_request) | |
run: | | |
echo "TAGS=${{ github.sha }}" >> $GITHUB_ENV | |
if: ${{ github.event_name == 'pull_request' }} | |
- name: Determine tags to set (push) | |
run: | | |
echo "TAGS=${{ github.sha }} ${{ github.ref_name }}" >> $GITHUB_ENV | |
if: ${{ github.event_name == 'push' }} | |
- name: Login to Github Packages | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build differ image | |
id: build-image-differ | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
containerfiles: "Dockerfile_differ" | |
image: ghcr.io/jelmer/janitor/differ | |
tags: ${{ env.TAGS }} | |
- name: Push differ image to ghcr.io | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image-differ.outputs.image }} | |
tags: ${{ steps.build-image-differ.outputs.tags }} | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} |