Run 'poetry update' and create a PR #143
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: "Run 'poetry update' and create a PR" | |
on: | |
push: | |
branches: | |
- run-poetry-update-workflow | |
schedule: | |
- cron: '0 0 * * MON' | |
workflow_dispatch: | |
jobs: | |
task: | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- run: echo ::set-output name=build-id::$(date +'%Y.%m.%dT%H%M%S') | |
id: configure | |
- run: | | |
cd images/uw-saml-poetry | |
poetry update --lock | |
id: poetry-update | |
- run: | | |
docker build -f images/poetry/Dockerfile -t ${{ env.dest_image }} -t ${{ env.latest_image }} images/poetry | |
docker push ${{ env.dest_image }} | |
docker push ${{ env.latest_image }} | |
echo ::notice::Pushed ${{ env.dest_image }} | |
env: | |
dest_image: ghcr.io/uwit-iam/poetry:${{ steps.configure.outputs.build-id }} | |
latest_image: ghcr.io/uwit-iam/poetry:latest | |
name: Re-build poetry base image | |
- run: | | |
set -x | |
docker build -f images/uw-saml-poetry/Dockerfile \ | |
--build-arg from_base_tag=${{ env.build_id }} \ | |
-t ${{ env.dest_image }} -t ${{ env.latest_image }} images/uw-saml-poetry | |
docker push ${{ env.dest_image }} | |
docker push ${{ env.latest_image }} | |
echo ::notice::Pushed ${{ env.dest_image }} | |
name: Re-build uw-saml-poetry image | |
env: | |
build_id: ${{ steps.configure.outputs.build-id }} | |
dest_image: ghcr.io/uwit-iam/uw-saml-poetry:${{ steps.configure.outputs.build-id }} | |
latest_image: ghcr.io/uwit-iam/uw-saml-poetry:latest | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
add-paths: images/uw-saml-poetry/poetry.lock | |
commit-message: ${{ env.message }} | |
delete-branch: true | |
title: ${{ env.message }} | |
assignees: jdiverp | |
reviewers: jdiverp | |
env: | |
message: > | |
[github actions] poetry update | |
(build-id: ${{ steps.configure.outputs.build-id }}) |