From 5f39632502c2210a09e041b0d432f76c84020cdc Mon Sep 17 00:00:00 2001 From: Trevor Campbell Date: Wed, 30 Aug 2023 21:54:44 -0700 Subject: [PATCH] add workflow to update environment.yml --- .github/workflows/update_environment.yml | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/update_environment.yml diff --git a/.github/workflows/update_environment.yml b/.github/workflows/update_environment.yml new file mode 100644 index 0000000..4e89432 --- /dev/null +++ b/.github/workflows/update_environment.yml @@ -0,0 +1,33 @@ +name: Update the environment file +on: + push: + branches: + - main + paths: + - Dockerfile +jobs: + rebuild-docker: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout main + uses: actions/checkout@v3 + with: + fetch-depth: '0' + ref: 'main' + - name: Build the docker image + run: docker build -t local < Dockerfile + - name: Generate the environment file + run: docker run --rm -v $(pwd):/home/jovyan/work local mamba env export > environment.yml + - name: Commit the updated env + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add env.yml + git commit -m "Update environment.yml based on new Docker image" + - name: Push changes to build scripts + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: 'main'