-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to update environment.yml
- Loading branch information
1 parent
1b6304e
commit 5f39632
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
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' |