Skip to content

Commit

Permalink
add workflow to update environment.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Aug 31, 2023
1 parent 1b6304e commit 5f39632
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/update_environment.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
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'

0 comments on commit 5f39632

Please sign in to comment.